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

Crates.io should not require the accept: header to contain the string html #960

Closed
AaronFriel opened this issue Aug 15, 2017 · 4 comments
Closed

Comments

@AaronFriel
Copy link

AaronFriel commented Aug 15, 2017

Microsoft Edge, curl, and likely other tools send Accept: */*. Crates.io is not accessible to these tools, and pages cannot be accessed via curl unless Accept: text/html or some variant containing html is sent.

crates.io/src/dist.rs

Lines 42 to 45 in d6eaeb8

let wants_html = req.headers()
.find("Accept")
.map(|accept| accept.iter().any(|s| s.contains("html")))
.unwrap_or(false);

@kureuil
Copy link
Contributor

kureuil commented Aug 15, 2017

What version of Edge are you using ? I can browse the site just fine using Microsoft Edge 40.15063.0.0 on Windows 10 Pro 1703.

What do you mean by "not accessible" ? Do you get an empty response ? a 404 ?
Does it looks like #788 ?

@AaronFriel
Copy link
Author

Yes, I get the 404 response because it did not send an Accept header that contains the string "html". I'm on the Insider Fast track on build 16257.

@AaronFriel
Copy link
Author

AaronFriel commented Aug 15, 2017

Update: It appears my Edge is now sending Accept: text/html, application/xhtml+xml, image/jxr, */*, and all I've done since yesterday is restart. No clue why Edge was sending Accept: */*. I'll file a ticket on that side, but the Crates.io server should consider */* to include "html".

@carols10cents
Copy link
Member

This indeed sounds like a duplicate of #788.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants