mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-02-21 01:42:08 +00:00
fix
This commit is contained in:
parent
36154a7ec4
commit
84946d28ff
@ -11,11 +11,13 @@ def sanitize_path(path:str, allow_absolute_path:bool=False, error_text="Absolute
|
||||
if (not allow_absolute_path) and Path(path).is_absolute():
|
||||
ASCIIColors.warning(error_text)
|
||||
raise exception_text
|
||||
return path
|
||||
|
||||
def sanitize_path_from_endpoint(path:str, error_text="A suspected LFI attack detected. The path sent to the server has .. in it!", exception_text="Invalid path!"):
|
||||
if (".." in path or Path(path).is_absolute()):
|
||||
ASCIIColors.error(error_text)
|
||||
raise HTTPException(status_code=400, detail=exception_text)
|
||||
return path
|
||||
|
||||
def forbid_remote_access(lollmsElfServer):
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
|
Loading…
x
Reference in New Issue
Block a user