fix: redirect issue

This commit is contained in:
ahoemann 2025-03-28 10:35:03 +01:00
parent 9dd416f8ab
commit 2f7d0f70e5
3 changed files with 3 additions and 2 deletions

View file

@ -6,7 +6,7 @@ ENV PASTE_DIR=pastes
COPY . . COPY . .
RUN apk add --no-cache python3 py3-flask py3-waitress cron RUN apk add --no-cache python3 py3-flask py3-waitress
EXPOSE 8080 EXPOSE 8080

2
app.py
View file

@ -28,7 +28,7 @@ def bin():
def view_paste(paste_id): def view_paste(paste_id):
file_path = os.path.join(paste_dir, paste_id) file_path = os.path.join(paste_dir, paste_id)
if not os.path.exists(file_path): if not os.path.exists(file_path):
return redirect("http://localhost:5000", code=302) return redirect("/", code=302)
with open(file_path, 'r') as f: with open(file_path, 'r') as f:
content = f.read() content = f.read()

1
paste/2f2ffb8b71cb9370 Normal file
View file

@ -0,0 +1 @@
tsetst