I'm building a library for Elixir that talks to the cardano-wallet and I think I found a bug.
The content-type header seems to be missing when calling http://localhost:8090/v2/wallets/
This is the headers I get back:
{"date", "Thu, 01 Apr 2021 21:12:48 GMT"},
{"server", "Warp/3.3.5"},
{"content-length", "122"}
If I call the same endpoint but with a badly formatted id which returns a status code 400 I get these headers:
{"date", "Thu, 01 Apr 2021 21:12:48 GMT"},
{"server", "Warp/3.3.5"},
{"content-length", "92"},
{"content-type", "application/json;charset=utf-8"}
The problem with this is that the content type is used by many http clients to automatically decode the json response to a struct so the implementation will be cluttered with workarounds.
Good catch thanks. It may actually be the case for other endpoints too :thinking: , we should test this generically using the API data types to make sure not to miss any.
I also remember seeing some non-JSON plain text error responses from the API - which would be annoying for API consumers which unconditionally expect JSON. But I forget which error it was... edit: it is the unhandled exception 500 response.
Anyway, WIP PR #2597.
Most helpful comment
I also remember seeing some non-JSON plain text error responses from the API - which would be annoying for API consumers which unconditionally expect JSON. But I forget which error it was... edit: it is the unhandled exception 500 response.
Anyway, WIP PR #2597.