rkd77 / elinks

Fork of elinks
Other
350 stars 38 forks source link

elinks does not seem to send Accept header. #143

Open Merivuokko opened 2 years ago

Merivuokko commented 2 years ago

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.

rkd77 commented 2 years ago

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

Merivuokko commented 2 years ago

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

rkd77 commented 2 years ago

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

smemsh commented 2 years ago

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

rkd77 commented 2 years ago

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