Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// Append development context
if (incoming.development) {
incoming.context = Object.assign(
this.baseContext,
{ mountOrigin: incoming.url.origin },
this.defaultContext,
);
this.log.debug(
`Appending a default context to inbound request "${JSON.stringify(
incoming.context,
)}"`,
);
} else {
incoming.context = utils.deserializeContext(
incoming.request.headers,
);
this.log.debug(
`Inbound request contains a context "${JSON.stringify(
incoming.context,
)}"`,
);
}
// Determin if the request should be proxied and do if so
if (incoming.development && proxy) {
await this.httpProxy.process(incoming);
}
return incoming;
}