2023-08-08 03:56:15 +02:00
|
|
|
diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js
|
2024-08-14 17:45:01 +02:00
|
|
|
index dd7b3c8..a339896 100644
|
2023-08-08 03:56:15 +02:00
|
|
|
--- a/node_modules/express/lib/response.js
|
|
|
|
+++ b/node_modules/express/lib/response.js
|
|
|
|
@@ -27,7 +27,6 @@ var merge = require('utils-merge');
|
|
|
|
var sign = require('cookie-signature').sign;
|
|
|
|
var normalizeType = require('./utils').normalizeType;
|
|
|
|
var normalizeTypes = require('./utils').normalizeTypes;
|
|
|
|
-var setCharset = require('./utils').setCharset;
|
|
|
|
var cookie = require('cookie');
|
|
|
|
var send = require('send');
|
|
|
|
var extname = path.extname;
|
2024-08-14 17:45:01 +02:00
|
|
|
@@ -54,7 +53,6 @@ module.exports = res
|
|
|
|
* @private
|
|
|
|
*/
|
2023-08-08 03:56:15 +02:00
|
|
|
|
|
|
|
-var charsetRegExp = /;\s*charset\s*=/;
|
2024-08-14 17:45:01 +02:00
|
|
|
var schemaAndHostRegExp = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\/[^\\\/\?]+/;
|
|
|
|
|
2023-08-08 03:56:15 +02:00
|
|
|
/**
|
2024-08-14 17:45:01 +02:00
|
|
|
@@ -165,16 +163,6 @@ res.send = function send(body) {
|
2023-08-08 03:56:15 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
- // write strings in utf-8
|
|
|
|
- if (typeof chunk === 'string') {
|
|
|
|
- encoding = 'utf8';
|
|
|
|
- type = this.get('Content-Type');
|
|
|
|
-
|
|
|
|
- // reflect this in content-type
|
|
|
|
- if (typeof type === 'string') {
|
|
|
|
- this.set('Content-Type', setCharset(type, 'utf-8'));
|
|
|
|
- }
|
|
|
|
- }
|
2024-08-14 17:45:01 +02:00
|
|
|
|
2023-08-08 03:56:15 +02:00
|
|
|
// determine if ETag should be generated
|
|
|
|
var etagFn = app.get('etag fn')
|
2024-08-14 17:45:01 +02:00
|
|
|
@@ -781,17 +769,6 @@ res.header = function header(field, val) {
|
2023-08-08 03:56:15 +02:00
|
|
|
? val.map(String)
|
|
|
|
: String(val);
|
|
|
|
|
|
|
|
- // add charset to content-type
|
|
|
|
- if (field.toLowerCase() === 'content-type') {
|
|
|
|
- if (Array.isArray(value)) {
|
|
|
|
- throw new TypeError('Content-Type cannot be set to an Array');
|
|
|
|
- }
|
|
|
|
- if (!charsetRegExp.test(value)) {
|
|
|
|
- var charset = mime.charsets.lookup(value.split(';')[0]);
|
|
|
|
- if (charset) value += '; charset=' + charset.toLowerCase();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
this.setHeader(field, value);
|
|
|
|
} else {
|
|
|
|
for (var key in field) {
|