Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2 -> main] Return application/json for all http responses including errors #337

Merged
merged 4 commits into from
Oct 17, 2022

Conversation

heifner
Copy link
Member

@heifner heifner commented Oct 17, 2022

Revert to 3.1 behavior of always returning application/json for all http responses including errors. The non-JSON responses came in as part of the boost beast backport #22.

Example:

curl -v http://localhost:8888/hi
*   Trying 127.0.0.1:8888...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8888 (#0)
> GET /hi HTTP/1.1
> Host: localhost:8888
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: application/json
< Server: Boost.Beast/266
< Access-Control-Allow-Origin: *
< Content-Length: 212
<
* Connection #0 to host localhost left intact
{"code":404,"message":"Not Found","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"Unknown Endpoint","file":"beast_http_session.hpp","line_number":159,"method":"handle_request"}]}}%

Resolves #324
Merges #326 into main

@heifner heifner requested a review from oschwaldp-oci October 17, 2022 16:56
@heifner heifner added the OCI Work exclusive to OCI team label Oct 17, 2022
@heifner heifner merged commit 4890d44 into main Oct 17, 2022
@heifner heifner deleted the GH-324-http-json-main branch October 17, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.2.0-rc1 doesn't handle API not found errors correctly
2 participants