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

http encoding feature #240

Merged
merged 1 commit into from
Jul 26, 2024
Merged

http encoding feature #240

merged 1 commit into from
Jul 26, 2024

Conversation

StuartHarris
Copy link
Member

@StuartHarris StuartHarris commented May 18, 2024

Nightly clippy reported that the crux_http crate was using the feature encoding, which wasn't declared in Cargo.toml. This fixes that. But we should agree that this is what we want to do.

Note that the decode_body function changes to use encoding_rs for non-wasm targets, and web-sys for wasm targets.

@StuartHarris StuartHarris requested a review from obmarg May 20, 2024 09:35
@obmarg
Copy link
Collaborator

obmarg commented May 20, 2024

But we should agree that this is what we want to do.

I wonder if it is. Looks like this feature allows you to use body_string with non-utf8 encodings. Which I suppose could be useful (although I can't think of a time I've ever needed that personally) - but I wonder if it's useful enough. I'd certainly be tempted to have it as an opt-in feature rather than a default, maybe even to ditch it altogether? Although not certain ditching it is the right move...

@obmarg
Copy link
Collaborator

obmarg commented May 20, 2024

Although having said that, maybe every server has been sending me utf-16 and I've just never noticed because of features like these. I don't know, maybe forget I spoke

@StuartHarris
Copy link
Member Author

StuartHarris commented May 20, 2024

maybe forget I spoke

Haha! It looks to me like the implementation that uses encoding_rs could be better if it uses copy-on-write semantics, not sure.

@charypar
Copy link
Member

charypar commented Jul 3, 2024

@StuartHarris what do we wanna do about this then? 👀

@StuartHarris
Copy link
Member Author

Since Rust 1.80.0 (out today) CI builds will fail with a warning that the encoding feature doesn't exist, so I'm going to merge this and we should update all open PRs from master.

@StuartHarris StuartHarris merged commit f283be6 into master Jul 26, 2024
9 checks passed
@StuartHarris StuartHarris deleted the http-encoding branch July 26, 2024 08:31
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.

3 participants