http_server.js (871:3c679d901524) http_server.js (873:89f7d6b67fa7)
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6'use strict';
7
8const EventEmitter = require('events');

--- 91 unchanged lines hidden (view full) ---

100};
101
102ServerResponse.prototype.removeHeader = function removeHeader(name) {
103 if (!(name in this.headers)) {
104 return;
105 }
106
107 let name_len = Buffer.byteLength(name + "", 'latin1');
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6'use strict';
7
8const EventEmitter = require('events');

--- 91 unchanged lines hidden (view full) ---

100};
101
102ServerResponse.prototype.removeHeader = function removeHeader(name) {
103 if (!(name in this.headers)) {
104 return;
105 }
106
107 let name_len = Buffer.byteLength(name + "", 'latin1');
108 let value = this.headers[name];
108
109
109 if (Array.isArray(this.headers[name])) {
110 this.headers_count -= this.headers[name].length;
111 this.headers_len -= this.headers[name].length * name_len;
110 delete this.headers[name];
112
111
113 this.headers[name].forEach(function(val) {
112 if (Array.isArray(value)) {
113 this.headers_count -= value.length;
114 this.headers_len -= value.length * name_len;
115
116 value.forEach(function(val) {
114 this.headers_len -= Buffer.byteLength(val + "", 'latin1');
115 });
116
117 this.headers_len -= Buffer.byteLength(val + "", 'latin1');
118 });
119
117 } else {
118 this.headers_count--;
119 this.headers_len -= name_len + Buffer.byteLength(this.headers[name] + "", 'latin1');
120 return;
120 }
121
121 }
122
122 delete this.headers[name];
123 this.headers_count--;
124 this.headers_len -= name_len + Buffer.byteLength(value + "", 'latin1');
123};
124
125ServerResponse.prototype.sendDate = function sendDate() {
126 throw new Error("Not supported");
127};
128
129ServerResponse.prototype.setTimeout = function setTimeout(msecs, callback) {
130 this.timeout = msecs;

--- 240 unchanged lines hidden ---
125};
126
127ServerResponse.prototype.sendDate = function sendDate() {
128 throw new Error("Not supported");
129};
130
131ServerResponse.prototype.setTimeout = function setTimeout(msecs, callback) {
132 this.timeout = msecs;

--- 240 unchanged lines hidden ---