Merge pull request #19010 from CyberAndrii/18957-fix-error-on-empty-response-headers
Fix error on empty response headers
This commit is contained in:
commit
cbb02eb655
@ -273,15 +273,17 @@ class PDFNetworkStreamFullRequestReader {
|
|||||||
const fullRequestXhrId = this._fullRequestId;
|
const fullRequestXhrId = this._fullRequestId;
|
||||||
const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);
|
const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);
|
||||||
|
|
||||||
|
const rawResponseHeaders = fullRequestXhr.getAllResponseHeaders();
|
||||||
const responseHeaders = new Headers(
|
const responseHeaders = new Headers(
|
||||||
fullRequestXhr
|
rawResponseHeaders
|
||||||
.getAllResponseHeaders()
|
? rawResponseHeaders
|
||||||
.trim()
|
.trim()
|
||||||
.split(/[\r\n]+/)
|
.split(/[\r\n]+/)
|
||||||
.map(x => {
|
.map(x => {
|
||||||
const [key, ...val] = x.split(": ");
|
const [key, ...val] = x.split(": ");
|
||||||
return [key, val.join(": ")];
|
return [key, val.join(": ")];
|
||||||
})
|
})
|
||||||
|
: []
|
||||||
);
|
);
|
||||||
|
|
||||||
const { allowRangeRequests, suggestedLength } =
|
const { allowRangeRequests, suggestedLength } =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user