Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Sec Insights
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Sec Insights
Commits
30e5648c
Commit
30e5648c
authored
3 days ago
by
Sourabh Desai
Browse files
Options
Downloads
Patches
Plain Diff
cors
parent
638f089c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/app/core/config.py
+2
-2
2 additions, 2 deletions
backend/app/core/config.py
backend/app/main.py
+1
-1
1 addition, 1 deletion
backend/app/main.py
with
3 additions
and
3 deletions
backend/app/core/config.py
+
2
−
2
View file @
30e5648c
import
os
from
enum
import
Enum
from
typing
import
List
,
Union
,
Optional
from
typing
import
List
,
Union
,
Optional
,
Literal
from
pydantic_settings
import
BaseSettings
,
SettingsConfigDict
from
pydantic
import
AnyHttpUrl
,
EmailStr
,
field_validator
...
...
@@ -70,7 +70,7 @@ class Settings(PreviewPrefixedSettings):
# BACKEND_CORS_ORIGINS is a JSON-formatted list of origins
# e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \
# "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]'
BACKEND_CORS_ORIGINS
:
List
[
AnyHttpUrl
]
=
[]
BACKEND_CORS_ORIGINS
:
List
[
AnyHttpUrl
|
Literal
[
"
*
"
]
]
=
[]
@property
def
VERBOSE
(
self
)
->
bool
:
...
...
This diff is collapsed.
Click to expand it.
backend/app/main.py
+
1
−
1
View file @
30e5648c
...
...
@@ -110,7 +110,7 @@ if settings.BACKEND_CORS_ORIGINS:
# allow all origins
app
.
add_middleware
(
CORSMiddleware
,
allow_origins
=
origins
,
allow_origins
=
[
str
(
origin
)
for
origin
in
origins
]
,
allow_origin_regex
=
"
https://llama-app-frontend.*\.vercel\.app
"
,
allow_credentials
=
True
,
allow_methods
=
[
"
*
"
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment