WebOfTrust / keripy

Key Event Receipt Infrastructure - the spec and implementation of the KERI protocol
https://keripy.readthedocs.io/en/latest/
Apache License 2.0
56 stars 53 forks source link

Invalid content-type in Keri agent http error messages #314

Closed psteniusubi closed 10 months ago

psteniusubi commented 1 year ago

Steps to reproduce

  1. Reset
  2. Start Keri agent
  3. Run GET /ids/notfound or GET /contacts/unknown

keripy is at revision ed016a06c56a1faaff26f2cca24b8b9e385ffc54

$ kli agent vlei

$ curl -s -X POST "http://localhost:5620/boot" -H "accept: */*" -H "Content-Type: application/json" -d "{\"name\":\"alias1\",\"passcode\":\"DoB2-6Fj4x-9Lbo-AFWJr-a17O\",\"salt\":\"0ACDEyMzQ1Njc4OWxtbm9aBc\"}" | jq

$ curl -s -X PUT "http://localhost:5620/boot" -H "accept: */*" -H "Content-Type: application/json" -d "{\"name\":\"alias1\",\"passcode\":\"DoB2-6Fj4x-9Lbo-AFWJr-a17O\"}" | jq

$ sleep 3

GET /ids/notfound

Error message is misplaced into content-type header value

$ curl -i -s http://localhost:5620/ids/notfound
HTTP/1.1 404 Not Found
Content-Type: no identifier for alias notfound
Content-Length: 0
Server: Ioflo WSGI Server
Date: Fri, 23 Sep 2022 06:57:51 GMT

GET /contacts/unknown

Error message content type is json but body is plain text

$ curl -i -s http://localhost:5620/contacts/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
HTTP/1.1 404 Not Found
Content-Length: 71
Content-Type: application/json
Server: Ioflo WSGI Server
Date: Fri, 23 Sep 2022 06:58:15 GMT

BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha is not a known identifier.
pfeairheller commented 10 months ago

Agent removed from KERIpy for WebOfTrust/KERIA