question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-conformant Accept header

See original GitHub issue

With the recent fix for #470, HTTPie sends:

Accept: application/json, */*

This header is not quite correct. According to RFC 7231 § 5.3.2, it says: “I accept JSON or anything else”. Because there are no explicit quality values (q=) specified for either media range, they are both assumed to be 1, so application/json and */* are equally acceptable.

*/* should be marked with a lower quality value, for example:

Accept: application/json, */*;q=0.5

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
inkstakcommented, Jul 4, 2019

Another example.

Sending a request with such Accept header to a Rails app, which is serving browsers & API, will always return an HTML response :

https://github.com/rails/rails/issues/8987

As @kjmph said, it’s because some browsers don’t set quality score correctly.

We can assume this behavior should be quite common to many other web servers

1reaction
inkstakcommented, Apr 3, 2020

Hi @jakubroztocil, did you take a look on last comments ? Is it possible to reconsider your position on this problem ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nonconforming Acceptance Sample Clauses - Law Insider
Nonconforming Acceptance a) IBM may choose to accept Products which fail to ... on the Pack Header or Pack Trailer records (i.e. out-of-balance...
Read more >
Warning message when calling a SOAP webservice
endsWith("\"")) ) { LOGGER.warning("Received WS-I BP non-conformant Unquoted SoapAction HTTP header: "+ soapAction); String fixedSoapAction ...
Read more >
net/http: CanonicalHeaderKey capitalization is non ... - GitHub
CanonicalizeHeaderKey returns header keys capitalized as Sec-Websocket-* (without the uppercase S in Socket ). While this may not seem like a ...
Read more >
ICMPv6 Errors for Discarding Packets Due to Processing Limits
Network nodes may discard packets if they are unable to process protocol headers of packets due to processing constraints or limits.
Read more >
core - Apache HTTP Server Version 2.4
The httpready accept filter buffers entire HTTP requests at the kernel level. ... This directive enables the generation of Content-MD5 headers as defined...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found