puppeteer-core
Version:
A high-level API to control headless Chrome over the DevTools Protocol
24 lines • 574 B
JavaScript
/**
* @license
* Copyright 2025 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Normalizes HTTP header values by handling multiline values.
* Multiline header values are joined with commas according to HTTP/1.1 spec.
*
* @internal
*/
export function normalizeHeaderValue(name, value) {
if (!value.includes('\n')) {
return value;
}
return value
.split('\n')
.map(v => {
return v.trim();
})
.filter(Boolean)
.join(name === 'set-cookie' ? '\n ' : ', ');
}
//# sourceMappingURL=httpUtils.js.map