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

Allow construction of HeaderValue from String #1253

Open
nazar-pc opened this issue Apr 17, 2024 · 3 comments
Open

Allow construction of HeaderValue from String #1253

nazar-pc opened this issue Apr 17, 2024 · 3 comments
Labels
proposal Enhancement idea or proposal

Comments

@nazar-pc
Copy link

Proposed change

If there is already allocated String with valid contents, it should be possible to create HeaderValue without unnecessary re-allocation going through &str.

Use case

To improve efficiency

Contribution

No response

@nazar-pc nazar-pc added the proposal Enhancement idea or proposal label Apr 17, 2024
@nazar-pc
Copy link
Author

Funnily enough, FromStr checks for new lines in HeaderValue and From<&str> doesn't. Is that a bug?

@paolobarbolini
Copy link
Contributor

Funnily enough, FromStr checks for new lines in HeaderValue and From<&str> doesn't. Is that a bug?

🤷‍♂️ nats-io/nats-architecture-and-design#236

@Jarema
Copy link
Member

Jarema commented Apr 21, 2024

Hey!
I will have a run over those validation next week to make them consistent and not affecting perf.
HeaderValue from String is ok to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

3 participants