fix: redirect issue
This commit is contained in:
parent
9dd416f8ab
commit
2f7d0f70e5
3 changed files with 3 additions and 2 deletions
|
@ -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
2
app.py
|
@ -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
1
paste/2f2ffb8b71cb9370
Normal file
|
@ -0,0 +1 @@
|
||||||
|
tsetst
|
Loading…
Add table
Reference in a new issue