Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function parseRequestHeaders(request) {
const externalRequestHeaders = {
...request.headers,
...getAuthHeaders(request),
...getClientIpHeader(request),
...getTrackingHeaders(request),
'accept-language': getLanguageHeader(request),
'x-meetup-agent': config.package.agent,
'x-meetup-parent-request-id': request.id,
};
delete externalRequestHeaders['host']; // let app server set 'host'
delete externalRequestHeaders['accept-encoding']; // let app server set 'accept'
delete externalRequestHeaders['content-length']; // original request content-length is irrelevant
delete externalRequestHeaders['content-type']; // the content type will be set in buildRequestArgs
return externalRequestHeaders;
}
export function parseRequestHeaders(request) {
const externalRequestHeaders = {
...request.headers,
...getAuthHeaders(request),
...getClientIpHeader(request),
...getTrackingHeaders(request),
'accept-language': getLanguageHeader(request),
'x-meetup-agent': config.package.agent,
'x-meetup-parent-request-id': request.id,
};
delete externalRequestHeaders['host']; // let app server set 'host'
delete externalRequestHeaders['accept-encoding']; // let app server set 'accept'
delete externalRequestHeaders['content-length']; // original request content-length is irrelevant
delete externalRequestHeaders['content-type']; // the content type will be set in buildRequestArgs
return externalRequestHeaders;
}