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

client: add default user agent #140

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Fishrock123
Copy link
Member

As suggested in discord, I think.


mod decode;
mod encode;

pub use decode::decode;
pub use encode::Encoder;

lazy_static! {
static ref DEFAULT_USER_AGENT: String = format!("http-rs-h1/{}", env!("CARGO_PKG_VERSION"));
Copy link
Member Author

Choose a reason for hiding this comment

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

Unsure what to call it, async-h1 seems wrong when used by e.g. surf, but also maybe surf should override it anyways. Unsure.

Copy link
Member

Choose a reason for hiding this comment

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

+1 for surf overriding or appending. why not async-h1, though, since that's the name of the crate? Then it could be something like surf/2.0.0 (async-h1/6.0.0)

@Fishrock123 Fishrock123 marked this pull request as draft September 14, 2020 23:03
@Fishrock123
Copy link
Member Author

Note: the tests for this are brittle. The order of added header is non-deterministic (HashMap iterator).

@jbr
Copy link
Member

jbr commented Oct 4, 2020

Seems reasonable to sort headers by either addition order or alphabetically

@Fishrock123
Copy link
Member Author

The problem is we are comparing to raw output files and unless headers are always going to be sorted there isn't a way to do that just for test output without re-writing the tests.

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.

None yet

2 participants