in-process-request
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -26,2 +26,9 @@ "use strict"; | ||
}; | ||
const isUTF8 = (headers) => { | ||
if (headers['content-encoding']) { | ||
return false; | ||
} | ||
const contentType = headers['content-type'] || ''; | ||
return contentType.match(/charset=utf-8/i) ? true : false; | ||
}; | ||
exports.createMockResponse = (req) => { | ||
@@ -51,3 +58,3 @@ const res = new http_1.ServerResponse(req); | ||
body, | ||
isUTF8: !!(headers['content-type'] || '').match(/charset=utf-8/i), | ||
isUTF8: isUTF8(headers), | ||
statusCode: res.statusCode, | ||
@@ -54,0 +61,0 @@ headers, |
{ | ||
"name": "in-process-request", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -5,0 +5,0 @@ "scripts": { |
11005
169