diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-08-08 11:56:15 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-08-08 11:56:15 +1000 |
commit | d811b20aab13dc42e913ee8162622b04a9597339 (patch) | |
tree | 8a258b23ed81baf6da3eb2d2a9fcaafb5c883a36 /patches | |
parent | Gateway close if user could not be fetched just send ID (diff) | |
download | server-d811b20aab13dc42e913ee8162622b04a9597339.tar.xz |
close #939
Diffstat (limited to 'patches')
-rw-r--r-- | patches/express+4.18.2.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/patches/express+4.18.2.patch b/patches/express+4.18.2.patch new file mode 100644 index 00000000..de52db60 --- /dev/null +++ b/patches/express+4.18.2.patch @@ -0,0 +1,62 @@ +diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js +index fede486..e3d868e 100644 +--- 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; +@@ -49,13 +48,6 @@ var res = Object.create(http.ServerResponse.prototype) + + module.exports = res + +-/** +- * Module variables. +- * @private +- */ +- +-var charsetRegExp = /;\s*charset\s*=/; +- + /** + * Set status `code`. + * +@@ -164,17 +156,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' +@@ -780,17 +761,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'); +- } +- 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) { |