Node.js: fixed handling of response header fields.

This fixes two issues:

- values for mutiple header fields with the same name
  passed as arrays were converted to string;

- the type of field value wasn't preserved as required
  by specification.
This commit is contained in:
Alexander Borisov
2018-11-15 15:21:52 +03:00
parent 06b404feb1
commit fb18a09cd7
2 changed files with 26 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ ServerResponse.prototype.setHeader = function setHeader(key, value) {
this.removeHeader(key);
this.headers[key] = value + "";
this.headers[key] = value;
this.headers_len += header_len + (header_key_len * header_count);
this.headers_count += header_count;
};