1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #19214 from Snuffleupagus/issue-19205

Don't remove trailing regular spaces from the "raw" response headers (issue 19205)
This commit is contained in:
Tim van der Meij 2024-12-15 15:51:20 +01:00 committed by GitHub
commit 322616988e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -288,7 +288,8 @@ class PDFNetworkStreamFullRequestReader {
const responseHeaders = new Headers(
rawResponseHeaders
? rawResponseHeaders
.trim()
.trimStart()
.replace(/[^\S ]+$/, "") // Not `trimEnd`, to keep regular spaces.
.split(/[\r\n]+/)
.map(x => {
const [key, ...val] = x.split(": ");