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

Fix Content-Type overriding #1956

Merged
merged 1 commit into from Sep 18, 2014
Merged

Fix Content-Type overriding #1956

merged 1 commit into from Sep 18, 2014

Conversation

@gergoerdosi
Copy link
Contributor

@gergoerdosi gergoerdosi commented Sep 18, 2014

Similarly to #1760 it's not possible to use custom Content-Type header for files. The following doesn't work:

reply.file('./example').type('application/json');

The returned Content-Type header is application/octet-stream. This pull request fixes the issue and returns application/json.

self.type(Mime.path(path).type || 'application/octet-stream');

if (!self.headers['content-type']) {
self.type(Mime.path(path).type || 'application/octet-stream');
Copy link
Contributor

@hueniverse hueniverse Sep 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 spaces

Loading

Copy link
Contributor Author

@gergoerdosi gergoerdosi Sep 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the PR.

Loading

@hueniverse hueniverse added the bug label Sep 18, 2014
@hueniverse hueniverse self-assigned this Sep 18, 2014
hueniverse pushed a commit that referenced this issue Sep 18, 2014
@hueniverse hueniverse merged commit e344a01 into hapijs:master Sep 18, 2014
1 check passed
Loading
@hueniverse hueniverse added this to the 6.9.0 milestone Sep 18, 2014
@gergoerdosi gergoerdosi deleted the content-type branch Sep 18, 2014
@lock
Copy link

@lock lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

Loading

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

Successfully merging this pull request may close these issues.

None yet

2 participants