Fix content disposition header access #7144
Open
+50
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue where Content-Disposition and other headers are visible in the browser Network tab but not accessible via response.headers in JavaScript code.
Problem:-
Due to CORS restrictions, XMLHttpRequest.getAllResponseHeaders() doesn't include certain headers like Content-Disposition, even though they're visible in the browser's Network tab and accessible via individual getResponseHeader() calls.
Solution:-
Enhanced the XHR adapter to:
First get headers via getAllResponseHeaders() (existing behavior)
Then try to get commonly needed headers individually via getResponseHeader()
Add any accessible headers that weren't included in the bulk response
Headers Now Accessible:
content-disposition
content-range
content-encoding
content-length
content-type
last-modified
date
etag
expires
cache-control
Testing:-
Verified fix works — Content-Disposition header is now accessible via response.headers['content-disposition'].