Fix Invalid Path Resource error

This commit is contained in:
Roberto Abdelkader Martínez Pérez committed 2019-08-30 12:33:29 +02:00
1 parent 6e5633a460
commit c9a9e90a7e
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -181,7 +181,10 @@ async def get_field(request):
except KeyError:
response = web.HTTPNotFound()
else:
content = await connection.get(field)
try:
content = await connection.get(field)
except ValueError:
return web.Response(status=400, reason="Invalid Resource Path")
if isinstance(content, StreamReader):
response = web.StreamResponse(status=200, reason="OK")