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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

http encoding feature #240

wants to merge 1 commit into from

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.

examples/counter/Cargo.toml Outdated Show resolved Hide resolved
@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.

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

3 participants