Newer
Older
percord / patches / express+5.2.1.patch
@Rory& Rory& on 3 Dec 1 KB Bump deps
diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js
index 7a2f0ec..a78e09b 100644
--- a/node_modules/express/lib/response.js
+++ b/node_modules/express/lib/response.js
@@ -26,7 +26,6 @@ var statuses = require('statuses')
 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;
@@ -153,17 +152,6 @@ res.send = function send(body) {
       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'));
-    }
-  }
-
   // determine if ETag should be generated
   var etagFn = app.get('etag fn')
   var generateETag = !this.get('ETag') && typeof etagFn === 'function'
@@ -675,14 +663,6 @@ res.header = function header(field, val) {
       ? 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');
-      }
-      value = mime.contentType(value)
-    }
-
     this.setHeader(field, value);
   } else {
     for (var key in field) {