Skip to content

Conversation

@nitin-999-code
Copy link

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'].

@github-actions github-actions bot added the pr::fix PR that fixes a bug label Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr::fix PR that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant