Give a Not Found if the ship in question doesn't exist (or at least make a best effort to)
This commit is contained in:
parent
a4abb98cd9
commit
1cb30fb282
1
app.py
1
app.py
|
@ -157,6 +157,7 @@ def ships(request):
|
|||
def ship(request,ship=None):
|
||||
if ship is None: return Response(Status.BAD_REQUEST,"Bad Request")
|
||||
ship_unquoted = urllib.parse.unquote(ship)
|
||||
if not os.path.isdir(os.path.join("/var/gopher",ship_unquoted)): return Response(Status.NOT_FOUND,"Not Found")
|
||||
def __generator():
|
||||
description = os.path.join("/var/gopher",ship_unquoted,".description")
|
||||
if os.path.exists(description):
|
||||
|
|
Loading…
Reference in New Issue