Update PoC and features with the 204 -> 404 update

Closes #33
This commit is contained in:
pancho horrillo
2019-10-04 17:20:47 +02:00
parent 97b8c3fce4
commit 6154210b3f
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -178,14 +178,14 @@ async def get_field(request):
try:
connection = CONNECTIONS[id]
except KeyError:
response = web.HTTPNotFound()
response = web.Response(status=404, reason="Handler ID Not Found")
else:
try:
content = await connection.get(field)
except ValueError:
return web.Response(status=400, reason="Invalid Resource Path")
except KeyError:
return web.Response(status=204, reason="Resource Item Not Found")
return web.Response(status=404, reason="Resource Item Not Found")
if isinstance(content, StreamReader):
response = web.StreamResponse(status=200, reason="OK")
@@ -211,7 +211,7 @@ async def set_field(request):
try:
connection = CONNECTIONS[id]
except KeyError:
response = web.HTTPNotFound()
response = web.Response(status=404, reason="Handler ID Not Found")
else:
try:
await connection.set(field, request.content)