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

Set trailers in res.trailers rather than res.headers. Fixes #56 #57

Merged
merged 1 commit into from Dec 30, 2015

Conversation

@mtharrison
Copy link
Member

mtharrison commented Dec 29, 2015

No description provided.

@mtharrison mtharrison changed the title Set trailers in res.trailers rather then res.headers. Fixes #56 Set trailers in res.trailers rather than res.headers. Fixes #56 Dec 29, 2015
if (headerParts.length === 2) {
response._headers[headerParts[0].trim().toLowerCase()] = headerParts[1].trim();
}
});

This comment has been minimized.

Copy link
@hueniverse

hueniverse Dec 29, 2015

Member

You need to still use the headers at the tail of the payload. That's the proper place to get them from so that it truly simulates the headers sent. Just need to assign them to the right property instead of lumping them with the normal headers.

This comment has been minimized.

Copy link
@mtharrison

mtharrison Dec 29, 2015

Author Member

Ok that makes sense. How does it look now?

@@ -183,6 +183,8 @@ internals.finish = function (response, req, onEnd) {

return function () {

const trailers = {};

This comment has been minimized.

Copy link
@hueniverse

hueniverse Dec 29, 2015

Member

This is odd way of doing it. Why not assign {} to res.trailers and then just assign directly to that?

This comment has been minimized.

Copy link
@mtharrison

mtharrison Dec 29, 2015

Author Member

Good point :) Fixed

@mtharrison mtharrison force-pushed the mtharrison:trailers branch from e7a1c1a to d158415 Dec 29, 2015
@hueniverse hueniverse self-assigned this Dec 30, 2015
@hueniverse hueniverse added this to the 2.0.2 milestone Dec 30, 2015
hueniverse added a commit that referenced this pull request Dec 30, 2015
Set trailers in res.trailers rather than res.headers. Fixes #56
@hueniverse hueniverse merged commit db0a55d into hapijs:master Dec 30, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.