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]: Download filename will be cut up to the first comma #29346
Comments
Does this behave differently than Chromium? There are a lot of search results regarding that topic https://foocompelsyou.wordpress.com/2012/10/01/the-curious-case-of-chrome-content-disposition-and-the-comma/ |
I haven't checked Chromium to be honest. But all modern browsers are ok including Chrome. So in case it's an error in Chromium it should be reported there? |
I'm not sure if Chrome and Chromium would behave differently, I don't think so. Can you provide steps to reproduce the issue in Electron? Can you host a URL that serves the problematic headers or provide steps to do that locally (e.g. this could be as simple as using netcat). And then a very basic Fiddle that triggers the problem? Otherwise the Electron team will have a hard time helping you. |
I cannot reproduce this on Ubuntu. http.txt
Serve via ncat on port 1337 ncat -l 1337 < http.txt Minimal Electron code: const {app, BrowserWindow} = require('electron')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600
})
mainWindow.loadURL('http://localhost:1337/')
}
app.whenReady().then(createWindow); |
Hey, I get the same bug, all versions > 12 are impacted. http.txt
Serve via ncat on port 1337 ncat -l 1337 < http.txt Minimal Electron code: const {app, BrowserWindow} = require('electron')
function createWindow () {
app.on('session-created', session => {
session.webRequest.onHeadersReceived((details, callback) => {
callback({ responseHeaders: details.responseHeaders });
});
});
const mainWindow = new BrowserWindow({
width: 800,
height: 600
})
mainWindow.loadURL('http://localhost:1337/')
}
app.whenReady().then(createWindow); |
I can reproduce this on Ubuntu now (@nornagon) thanks @alefoll Screenshot is 15-beta7 via Fiddle The parsing seems to incorrectly strip the double quotes, which breaks serializing it back. This is logged in
|
Hey @nornagon, do you have some time to look into it? |
Preflight Checklist
Electron Version
12.0.8
What operating system are you using?
Windows
Operating System Version
Windows 10
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Downloading a file with a comma in name should return full filename.
Actual Behavior
Filename is cut up to the first comma.
Testcase Gist URL
No response
Additional Information
I'm aware that filename in content-disposition should be quoted.
And I specifically checked that ASP.NET Core does it correctly.
What's interesting is that if i add additional double quotes it works (but adds additional underscores in normal browsers).
The text was updated successfully, but these errors were encountered: