elinks icon indicating copy to clipboard operation
elinks copied to clipboard

elinks does not seem to send Accept header.

Open Merivuokko opened this issue 2 years ago • 5 comments

Some sites can return different data with the same request URL depending on the Accept header sent by the client.

For example hackage.haskell.org and crates.io currently return application/json data, unless text/html is explicitly requested. If elinks asked for text/html these sites would function more like they should. There are most likely some other sites which work this way.

lynx seems to send this header.

Merivuokko avatar Apr 20 '22 08:04 Merivuokko

AFAIR elinks sent Accept: */* Now it is configurable. You can set protocol.http.accept arbitrarily.

rkd77 avatar Apr 20 '22 09:04 rkd77

On 2022-04-20 at 02:28 -0700, rkd77 @.***> wrote:

AFAIR elinks sent Accept: / Now it is configurable. You can set protocol.http.accept arbitrarily.

Great! Could the default be something more specific than /. It was very difficult for me to find out what the problem with these sites was, and I'm a developer. For people with less experience this kind of troubleshooting might be impossible.

-- Aura

Merivuokko avatar Apr 20 '22 09:04 Merivuokko

I don't know what to set as default. No changes seems good policy here.

rkd77 avatar Apr 20 '22 16:04 rkd77

Endpoints that can give web pages or API responses will be increasingly common. There's a weighting factor available in the header. Perhaps a good default would be:

text/html, text/*;q=0.9, */*;q=0.8

these priority specifications are at least in the 1.0 and 1.1 specs

smemsh avatar Jun 06 '22 19:06 smemsh

ok, let it be: text/html, text/*;q=0.9, /;q=0.8

rkd77 avatar Jun 07 '22 08:06 rkd77