File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ class Settings(BaseSettings):
2828 extra = "ignore" ,
2929 )
3030 PROJECT_NAME : str = "SQLBot"
31- API_V1_STR : str = "/api/v1"
31+ #CONTEXT_PATH: str = "/sqlbot"
32+ CONTEXT_PATH : str = ""
33+ API_V1_STR : str = CONTEXT_PATH + "/api/v1"
3234 SECRET_KEY : str = secrets .token_urlsafe (32 )
3335 # 60 minutes * 24 hours * 8 days = 8 days
3436 ACCESS_TOKEN_EXPIRE_MINUTES : int = 60 * 24 * 8
Original file line number Diff line number Diff line change @@ -67,6 +67,13 @@ def is_whitelisted(self, path: str) -> bool:
6767 prefix = settings .API_V1_STR
6868 if path .startswith (prefix ):
6969 path = path [len (prefix ):]
70+
71+ context_prefix = settings .CONTEXT_PATH
72+ if context_prefix and path .startswith (context_prefix ):
73+ path = path [len (context_prefix ):]
74+
75+ if not path :
76+ path = '/'
7077 if path in self .whitelist :
7178 return True
7279
You can’t perform that action at this time.
0 commit comments