Closed thomaseizinger closed 4 years ago
Currently, we simply send back our instances of HttpApiProblem as JSON:
HttpApiProblem
https://github.com/comit-network/comit-rs/blob/6616f56206b3a4d40feaaf15de40b9925a9dae6c/cnd/src/http_api/problem.rs#L149-L161
While not being wrong, it would be more correct to set the "content-type" header to application/problem+json to allow clients to actively identify them as "problems".
application/problem+json
The http-api-problem library provides a constant for that: https://github.com/chridou/http-api-problem/blob/3e59dc7b1bdd6e35eb9ae749e93aef9579d57371/src/lib.rs#L133-L134
@thomaseizinger back to backlog?
Currently, we simply send back our instances of
HttpApiProblem
as JSON:https://github.com/comit-network/comit-rs/blob/6616f56206b3a4d40feaaf15de40b9925a9dae6c/cnd/src/http_api/problem.rs#L149-L161
While not being wrong, it would be more correct to set the "content-type" header to
application/problem+json
to allow clients to actively identify them as "problems".The http-api-problem library provides a constant for that: https://github.com/chridou/http-api-problem/blob/3e59dc7b1bdd6e35eb9ae749e93aef9579d57371/src/lib.rs#L133-L134