molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 187 forks source link

Ensure Set-Cookie headers are always an array #179

Closed watson closed 8 years ago

watson commented 8 years ago

If I understand the purpose of this project correctly, one of the goals is to be 100% API compatible with the Node.js core http/https modules.

I found a minor difference in the way that http2 handles the Set-Cookie header: Node core will force it to be an array even if it the HTTP response only contains a single Set-Coolie header (source code).

This pull request tries to add the same functionality to the http2 module. It works with this PR, but I'm not entirely sure I've added the logic in the correct location as I had a hard time figuring out the structure of the source code. Please let me know if you want me to modify my pull request.