-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Not all cargo requests contains User-Agent header #8979
Comments
Could you perhaps share the configuration you have? (e.g. I've double-checked and there's only one place we create an HTTP request handle and it should always have the user-agent field set. Additionally those URLs don't look like ones that Cargo is creating, so are you sure that this is something that Cargo is doing? |
We found this issue in crates-io-cn/crates-io-cn#14. p.s. We now turn off the CDN check for User-Agents. You are probably not being able to reproduce the identical 403 response. cargo configuration:
|
Can you try running the command with: $ export CARGO_HTTP_DEBUG=true
$ export CARGO_LOG=cargo::ops::registry
$ cargo fetch and gist the output? Cargo should print the headers it sends on every request which would be useful to figure out which one is missing the user-agent header. |
Unfortunately I don't really know what's going on here, that log definitely shows Cargo not always sending a user-agent field. The HTTP handle is created here which is configured here and unconditionally sets the useragent here. Have you perhaps configured |
One suspicious thing I noticed in your debug output is that the I'm not familiar with |
Problem
Steps
Possible Solution(s)
Add missing fields.
Notes
Output of
cargo version
: cargo 1.48.0 (65cbdd2 2020-10-14)rustup: 1.23.1 (3df2264a9 2020-11-30)
toolchain: stable-x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: