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

Fix 403 errors from crates.io #110

Merged
merged 4 commits into from
Jul 6, 2019

Conversation

yan12125
Copy link
Contributor

@yan12125 yan12125 commented Jul 4, 2019

No description provided.

@yan12125
Copy link
Contributor Author

yan12125 commented Jul 4, 2019

As a side note, from https://tools.ietf.org/html/rfc7231:

A user agent SHOULD send a User-Agent field in each request unless specifically configured not to do so.

@yan12125 yan12125 force-pushed the investigate-crates-io-403 branch from 671bc2f to 1371e48 Compare July 4, 2019 14:40
@lilydjwg
Copy link
Owner

lilydjwg commented Jul 4, 2019 via email

@yan12125
Copy link
Contributor Author

yan12125 commented Jul 4, 2019

This can be forwarded to tornado.

I agree.

UPDATE: Opened tornadoweb/tornado#2702

@yan12125 yan12125 force-pushed the investigate-crates-io-403 branch from 65d794f to 1acf9eb Compare July 5, 2019 01:22
@yan12125 yan12125 changed the title Investigate 403 errors from crates.io Fix 403 errors from crates.io Jul 5, 2019
@yan12125 yan12125 marked this pull request as ready for review July 5, 2019 01:31
@yan12125
Copy link
Contributor Author

yan12125 commented Jul 5, 2019

AUR tests are still as flaky as usual :/

@lilydjwg
Copy link
Owner

lilydjwg commented Jul 5, 2019

I'd like to set the user agent in session so we don't need to set it per request. Also, the version can be added to the user agent string.

@yan12125
Copy link
Contributor Author

yan12125 commented Jul 5, 2019

I'd like to set the user agent in session so we don't need to set it per request. Also, the version can be added to the user agent string.

I'll check it out later.

By the way, do you think it's a good idea to elevate regex's user_agent to a gloabl option?

@lilydjwg
Copy link
Owner

lilydjwg commented Jul 5, 2019

A global user_agent is good but should be separate from the regex one. The regex one is to cope with sites that behave poorly with unexpected user agents (e.g. bilibili).

@yan12125 yan12125 force-pushed the investigate-crates-io-403 branch from 1acf9eb to 3d5ab61 Compare July 6, 2019 05:30
@yan12125
Copy link
Contributor Author

yan12125 commented Jul 6, 2019

Turns out global user_agent needs quite a few changes. I give up the idea this time.

@yan12125 yan12125 force-pushed the investigate-crates-io-403 branch from 3d5ab61 to 851e141 Compare July 6, 2019 05:40
@lilydjwg lilydjwg merged commit e12a9c4 into lilydjwg:master Jul 6, 2019
@lilydjwg
Copy link
Owner

lilydjwg commented Jul 6, 2019

pytest-httpbin doesn't work with nightly. Also it brings in too many dependencies. I'll remove it.

@yan12125
Copy link
Contributor Author

yan12125 commented Jul 6, 2019

Well, I still think it's better not to test against the actual httpbin.org site.

By the way, the Python 3.8 issue is already fixed in git-master of werkzeug: pallets/werkzeug#1551.

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

Successfully merging this pull request may close these issues.

2 participants