Compare commits
No commits in common. "d86807b5d40e584338f5e3f0b0384adf4a84c61a" and "2c58245f4b5a35f68b23d88cc8b3c0967f78bbc1" have entirely different histories.
d86807b5d4
...
2c58245f4b
@ -10,4 +10,4 @@ RUN apk add --no-cache --update libmagic \
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips='*'"]
|
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000", "--proxy-headers"]
|
||||||
|
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):
|
if exists(file_path):
|
||||||
remove(file_path)
|
remove(file_path)
|
||||||
if re.search("^curl/.*", str(user_agent)):
|
if re.search("^curl/.*", str(user_agent)):
|
||||||
return PlainTextResponse(f"file {file} deleted from the server\n")
|
return PlainTextResponse(f"file {file} doesn't exist on the server\n")
|
||||||
else:
|
else:
|
||||||
return RedirectResponse(request.url_for('files'))
|
return RedirectResponse(request.url_for('files'))
|
||||||
if re.search("^curl/.*", str(user_agent)):
|
if re.search("^curl/.*", str(user_agent)):
|
||||||
|
Loading…
Reference in New Issue
Block a user