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

Content type charset handling #3243

Closed
AdriVanHoudt opened this issue Jul 26, 2016 · 3 comments
Closed

Content type charset handling #3243

AdriVanHoudt opened this issue Jul 26, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@AdriVanHoudt
Copy link
Contributor

@AdriVanHoudt AdriVanHoudt commented Jul 26, 2016

I am replying with a csv and also want to set the header=present option.
My knowledge of the http headers spec only goes so far but I think the result I need is text/csv; charset=utf-8; header=present;
Now when I reply with reply(csv).type('text/csv; header=present;'); I get "text/csv; header=present;, charset=utf-8" as a result (due to https://github.com/hapijs/hapi/blob/master/lib/transmit.js#L496)
Am I doing something wrong or should I add the charset myself (which feels like a hack) like so:

var response = reply(csv);
response.type(`text/csv; charset=${response.settings.charset}; header=present;`);
@AdriVanHoudt
Copy link
Contributor Author

@AdriVanHoudt AdriVanHoudt commented Aug 17, 2016

@hueniverse any ideas on this?

@hueniverse hueniverse added the bug label Aug 23, 2016
@hueniverse hueniverse added this to the 15.0.0 milestone Aug 23, 2016
@hueniverse hueniverse self-assigned this Aug 23, 2016
@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Aug 23, 2016

This was a bug. I don't remember where that coma came from.

@AdriVanHoudt
Copy link
Contributor Author

@AdriVanHoudt AdriVanHoudt commented Aug 23, 2016

Thanks for fixing this! 🙏

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants