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]: Inconclusive Parsing of Content-Disposition Header #41939

Open
3 tasks done
gdavidkov opened this issue Apr 23, 2024 · 3 comments
Open
3 tasks done

[Bug]: Inconclusive Parsing of Content-Disposition Header #41939

gdavidkov opened this issue Apr 23, 2024 · 3 comments
Labels
30-x-y bug 🪲 component/webRequest has-repro-gist Issue can be reproduced with code at https://gist.github.com/

Comments

@gdavidkov
Copy link

gdavidkov commented Apr 23, 2024

Preflight Checklist

Electron Version

30.0.0

What operating system are you using?

Windows

Operating System Version

Microsoft Windows [Version 10.0.19045.4291]

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The "content-disposition" header shouldn't be modified and work as in Chromium. Please, take a look at the screenshots I've attached. The problem is in the function HttpResponseHeadersToV8 - https://github.com/electron/electron/blob/main/shell/browser/api/electron_api_web_request.cc#L93C22-L93C45

Actual Behavior

1a
2a

Testcase Gist URL

https://gist.github.com/gdavidkov/08a8edae420a5b30e9f855f0ebb75a63

Additional Information

Ref: #25961
PR: #31669

@electron-issue-triage electron-issue-triage bot added the has-repro-gist Issue can be reproduced with code at https://gist.github.com/ label Apr 23, 2024
@gdavidkov
Copy link
Author

When I try to add the missing information to the header, I encounter the following problem:
image
image

@gdavidkov
Copy link
Author

If the header is in not the correct format, the filename is empty. I think we should return the original header like in the Chromium.
3a
4a
5

@alfein
Copy link

alfein commented May 4, 2024

This bug is happening due to a change that was made in this pull request. Unfortunately, if the onHeadersReceived is used and client code needs to modify headers, the original value of the constent-disposition header is lost. Moreover the new value incorrectly includes a space before the word attachment and it drops the value of filename*, which is what should be used to avoid issues with filename encoding on the client side.

The PR should be undone. Reference to similar comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
30-x-y bug 🪲 component/webRequest has-repro-gist Issue can be reproduced with code at https://gist.github.com/
Projects
Status: 👀 Unsorted Items
Development

No branches or pull requests

3 participants