Skip to content

Commit 9b35bcb

Browse files
remove redundant code
1 parent 4a96c24 commit 9b35bcb

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

lib/requests/helpers/parseResponse.js

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ function parseBatchHeaders(text) {
138138
}
139139
} while (line && parts);
140140

141-
normalizeHeaders(headers);
142-
143141
return headers;
144142
}
145143

@@ -165,46 +163,6 @@ function readTo(text, ctx, str) {
165163
return text.substring(start, end);
166164
}
167165

168-
function normalizeHeaders(headers) {
169-
var keys = [];
170-
for (var i = 0; i < headers.length; ++i) {
171-
var key = normalizeHeader(headers[i]);
172-
if (key.length > 0) {
173-
keys.push(key);
174-
}
175-
}
176-
return keys;
177-
}
178-
179-
function normalizeHeader(header) {
180-
var key = "";
181-
var upperCase = false;
182-
for (var i = 0; i < header.length; ++i) {
183-
var letter = header[i];
184-
if (letter === " " && key.length > 0) {
185-
upperCase = true;
186-
continue;
187-
}
188-
if (!isAlnum(letter)) {
189-
continue;
190-
}
191-
if (key.length === 0 && isDigit(letter)) {
192-
continue;
193-
}
194-
if (upperCase) {
195-
upperCase = false;
196-
key += letter.toUpperCase();
197-
} else {
198-
key += letter.toLowerCase();
199-
}
200-
}
201-
return key;
202-
}
203-
204-
function isDigit(char) {
205-
return char >= "0" && char <= "9";
206-
}
207-
208166
//partially taken from https://github.com/emiltholin/google-api-batch-utils
209167
/**
210168
*

0 commit comments

Comments
 (0)