[Bug] Accept header not appended properly in 0.23.0-RC1
See original GitHub issueI tried the following ways to construct the Accept
header
Headers(
Accept(
MediaRangeAndQValue
.withDefaultQValue(MediaRange.parse("application/vnd.docker.distribution.manifest.v2+json").toOption.get)
),
Header.Raw(ci"Accept", "application/vnd.docker.distribution.manifest.v2+json"),
Accept.parse("application/vnd.docker.distribution.manifest.v2+json").toOption.get
)
But none of them actually appended the header properly.
In previous version, headers in a call looked like this
{"@timestamp":"2021-07-28T15:59:16.160Z","@version":"1","message":"HTTP/1.1 GET https://registry-1.docker.io/v2/rtitle/anvil-rstudio-base/blobs/sha256:aaf072362a3bfa231f444af7a05aa24dd83f6d94ba56b3d6d0b365748deac30a Headers(Accept: application/vnd.docker.distribution.manifest.v2+json, Authorization: <REDACTED>, Accept: application/json)","logger_name":"org.http4s.client.middleware.RequestLogger","thread_name":"scala-execution-context-global-1942","severity":"INFO","level_value":20000}
But it now looks like this with 0.23.0-RC1
{"@timestamp":"2021-07-28T16:07:41.141Z","@version":"1","message":"HTTP/1.1 GET https://registry-1.docker.io/v2/rtitle/anvil-rstudio-base/manifests/0.0.1 Headers(Content-Type: application/vnd.docker.distribution.manifest.v2+json, Authorization: <REDACTED>, Accept: application/json)","logger_name":"org.http4s.client.middleware.RequestLogger","thread_name":"io-compute-8","severity":"INFO","level_value":20000}
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
HTTP Accept header not handled correctly | Bitbucket Server
If the Accept header contains any of application/json, application/x-json, text/json, or text/x-json the request will return JSON. This is regardless of the ...
Read more >python - Is it a bug to omit an Accept */* header in an HTTP/1.0 ...
I presume that curl and requests add the default for a reason, but I'm not sure what that reason is. RFC 2616 for...
Read more >Prism is not respecting the Accept header · Issue #332 - GitHub
Describe the bug I'm getting empty responses from Prism mock server. To Reproduce Using this example specification: ...
Read more >Text_Wiki - PEAR - PHP Extension and Application Repository
Bug #12490 wiki's do not display since php5-5.2.5 upgrade but are ... php pyrus.phar install pear/Text_Wiki-1.2.0RC1 ... Heading: collapsing in headers
Read more >Important notes — Borg - Deduplicating Archiver 1.2.2 ...
A bug was discovered in our hashtable code, see issue #4829. The code is used for the client-side chunks cache and the server-side...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep!
Good way to tell on any repo: look at the commit on the fix. Up at the top, GitHub lists the tags that contain the commit.
All of the client methods that take an
EntityDecoder
do something like this. As a quick fix, if you put this function on a client syntax trait:And then just call
expectOptionOrHack
instead ofexpectOption
.I’ve been working toward the 0.23 release today. We’ll have a proper fix in that, and I’ll also release an 0.22.1 patch. Once that’s done, you can revert to the standard method, and all should be well.