Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Non-standard behavior: Electron alter the response header Content-Disposition #34896

Closed
3 tasks done
9percent opened this issue Jul 13, 2022 · 1 comment
Closed
3 tasks done
Labels

Comments

@9percent
Copy link

Preflight Checklist

Electron Version

15.3.1

What operating system are you using?

Windows

Operating System Version

Windows 11 with latest updates

What arch are you using?

x64

Last Known Working Electron version

15.3.0

Expected Behavior

If web server response a blob with file name specified in Content-Disposition with encoding, for example:
server response header include:
content-disposition: "attachment; filename*=UTF-8''filename.xlsx"
Electron should pass server response header Content-Disposition as it is in XMLHttpRequest so app JavaScript can handle it correctly, should not change it's value.

Actual Behavior

Due to the change in the PR: #31669
response header value content-disposition will be replaced if the value contains encoding info.
content-disposition: "attachment; filename*=UTF-8''filename.txt"
will be changed to:
content-disposition: "attachment; filename=\"filename.txt\""
If I inspect web request with dev tool, I can see the network panel shows the response header with original value, but in the JS XMLHttpRequest handler, I can only get the altered value instead, this should not happen as it is not expected when we need to handle the file name in the header with JS code.

Testcase Gist URL

No response

Additional Information

The commit:
24b02d6
The PR:
#31669
Some doc online:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

@jkleinsc
Copy link
Contributor

Thank you for reaching out!

The version of Electron reported in this issue has reached end-of-life and is no longer supported, so this issue will be closed.

If you're still experiencing this issue on a supported version of Electron, please file a new issue for that version of Electron.

Thanks in advance! Your help is appreciated.

@jkleinsc jkleinsc closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants