Skip to content

Content type charset handling #3243

@AdriVanHoudt

Description

@AdriVanHoudt

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;`);

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions