Compare commits

..

2 Commits

Author SHA1 Message Date
d86807b5d4 Update docker command. 2023-03-26 10:14:53 +02:00
ec3858ac6c Fix text return for curl when deleting file 2023-03-26 10:14:35 +02:00
2 changed files with 2 additions and 2 deletions

View File

@ -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"] CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips='*'"]

View File

@ -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} doesn't exist on the server\n") return PlainTextResponse(f"file {file} deleted from 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)):