Compare commits
2 Commits
2c58245f4b
...
d86807b5d4
Author | SHA1 | Date | |
---|---|---|---|
d86807b5d4 | |||
ec3858ac6c |
@ -10,4 +10,4 @@ RUN apk add --no-cache --update libmagic \
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000", "--proxy-headers"]
|
||||
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips='*'"]
|
||||
|
2
main.py
2
main.py
@ -104,7 +104,7 @@ async def delete(request: Request, file: str, user_agent: Annotated[Union[str, N
|
||||
if exists(file_path):
|
||||
remove(file_path)
|
||||
if re.search("^curl/.*", str(user_agent)):
|
||||
return PlainTextResponse(f"file {file} doesn't exist on the server\n")
|
||||
return PlainTextResponse(f"file {file} deleted from the server\n")
|
||||
else:
|
||||
return RedirectResponse(request.url_for('files'))
|
||||
if re.search("^curl/.*", str(user_agent)):
|
||||
|
Loading…
Reference in New Issue
Block a user