1
0
Fork 0
forked from svrjs/svrjs

Replace deep clone in getCustomHeaders() function with shallow clone

This commit is contained in:
Dorian Niemiec 2024-08-27 23:13:02 +02:00
parent 63633d1de1
commit fb887e4122
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ function clientErrorHandler(err, socket) {
generateServerString(config.exposeServerVersion); generateServerString(config.exposeServerVersion);
// getCustomHeaders() in SVR.JS 3.x // getCustomHeaders() in SVR.JS 3.x
config.getCustomHeaders = () => deepClone(config.customHeaders); config.getCustomHeaders = () => Object.assign({}, config.customHeaders);
// Prevent multiple error handlers from one request // Prevent multiple error handlers from one request
if (socket.__assigned__) { if (socket.__assigned__) {

View file

@ -40,7 +40,7 @@ function requestHandler(req, res) {
// getCustomHeaders() in SVR.JS 3.x // getCustomHeaders() in SVR.JS 3.x
config.getCustomHeaders = () => { config.getCustomHeaders = () => {
let ph = deepClone(config.customHeaders); let ph = Object.assign({}, config.customHeaders);
if (config.customHeadersVHost) { if (config.customHeadersVHost) {
let vhostP = null; let vhostP = null;
config.customHeadersVHost.every((vhost) => { config.customHeadersVHost.every((vhost) => {