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

util/network/http: Use cargo/1.2.3 user-agent header #13548

Merged
merged 2 commits into from
Mar 9, 2024

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Mar 6, 2024

... instead of cargo 1.2.3.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#syntax declares that the product and product version are usually separated by a slash. This commit changes the cargo User-Agent header to follow that syntax instead of using whitespace for the separator.

... instead of `cargo 1.2.3`.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#syntax declares that the product and product version are usually separated by a slash. This commit changes the cargo `User-Agent` header to follow that syntax instead of using whitespace for the separator.
@rustbot
Copy link
Collaborator

rustbot commented Mar 6, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-networking Area: networking issues, curl, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2024
@Turbo87
Copy link
Member Author

Turbo87 commented Mar 6, 2024

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might also want to update here:

- `User-Agent`: The Cargo version such as `cargo 1.32.0 (8610973aa

src/cargo/util/network/http.rs Show resolved Hide resolved
@weihanglo
Copy link
Member

I don't think we have any compatibility guarantee for the user agent header Cargo sends, and user agent parsing is notoriously imprecise. However, this could still potentially break data collections and analysis done by some proxy and private registry providers. Do you know any of them that we might want to contact in advance for this change?

@epage
Copy link
Contributor

epage commented Mar 6, 2024

Could post to build-integration as the people likely to be there are likely to be ones relying on this. There would also be custom registries.

@rustbot rustbot added the A-documenting-cargo-itself Area: Cargo's documentation label Mar 6, 2024
@Turbo87
Copy link
Member Author

Turbo87 commented Mar 6, 2024

You might also want to update here

Do you know any of them that we might want to contact in advance for this change?

The only one I know is our cargo versions dashboard on DataDog, but I've already adjusted the parser there to allow both styles :)

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to merge this. It's always good to follow the specs!

@weihanglo
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 6, 2024

📌 Commit c1f5fa6 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2024
@bors
Copy link
Contributor

bors commented Mar 6, 2024

⌛ Testing commit c1f5fa6 with merge 91fd2b8...

bors added a commit that referenced this pull request Mar 6, 2024
util/network/http: Use `cargo/1.2.3` user-agent header

... instead of `cargo 1.2.3`.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#syntax declares that the product and product version are usually separated by a slash. This commit changes the cargo `User-Agent` header to follow that syntax instead of using whitespace for the separator.
@weihanglo
Copy link
Member

Wait. Let me post it on Zulip first, as this doesn't seem to be really urgent.

@bors r-

@bors bors added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 6, 2024
@Turbo87
Copy link
Member Author

Turbo87 commented Mar 6, 2024

yeah, no urgency :)

@bors
Copy link
Contributor

bors commented Mar 6, 2024

☀️ Try build successful - checks-actions
Build commit: 91fd2b8 (91fd2b8a655afe760e734a9977a81e0c3963acfa)

@weihanglo weihanglo added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Mar 7, 2024
@weihanglo
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Mar 9, 2024

📌 Commit c1f5fa6 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 9, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 9, 2024
@bors
Copy link
Contributor

bors commented Mar 9, 2024

⌛ Testing commit c1f5fa6 with merge d79fdf3...

@bors
Copy link
Contributor

bors commented Mar 9, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing d79fdf3 to master...

@bors bors merged commit d79fdf3 into rust-lang:master Mar 9, 2024
21 checks passed
@Turbo87 Turbo87 deleted the user-agent branch March 9, 2024 17:41
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2024
Update cargo

9 commits in a4c63fe5388beaa09e5f91196c86addab0a03580..7065f0ef4aa267a7455e1c478b5ccacb7baea59c
2024-03-06 22:15:17 +0000 to 2024-03-12 13:25:15 +0000
- chore: remove repetitive word (rust-lang/cargo#13575)
- refactor(lockfile): Make diffing/printing more reusable (rust-lang/cargo#13564)
- test: Add tests for using worktrees and sparse checkouts (rust-lang/cargo#13567)
- util/network/http: Use `cargo/1.2.3` user-agent header (rust-lang/cargo#13548)
- fix: Consistently compare MSRVs (rust-lang/cargo#13537)
- refactor(shell): Use alternate to close links (rust-lang/cargo#13562)
- fix(doc): Collapse down Generated statuses without --verbose (rust-lang/cargo#13557)
- doc: Add doc for -Zpublic-dependency (rust-lang/cargo#13556)
- docs: add link to the exported_private_dependencies lint (rust-lang/cargo#13547)

r? ghost
@rustbot rustbot added this to the 1.78.0 milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-networking Area: networking issues, curl, etc. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants