Skip to content

this.res._headers has changed in node master #903

@ilkkao

Description

@ilkkao

Just compiled Node from the master branch and tried to use koa. It failed because the property values in this.res._headers are now arrays instead of strings.

$ node
> http = require('http');
> resp = new http.ServerResponse({});
> resp.setHeader('Content-Type', 'foo');
> result = resp._headers

In Node 7.x, result is { 'content-type': 'foo' }

In Node master (pre-8.0), result is { 'content-type': [ 'Content-Type', 'foo' ] }

The change was made here: nodejs/node@c00e4ad#diff-286202fdbdd74ede6f5f5334b6176b5cR406 (Node PR: nodejs/node#10558)

@mscdex noticed that it broke express and provided a fix https://github.com/jshttp/fresh/pull/20/files Something similar would be needed for koa.

I'll open this issue to make sure this issue is solved for koa in some way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions