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]: protocol.handle fails when filename contains '#' #42102

Closed
3 tasks done
KBriscoe opened this issue May 9, 2024 · 0 comments · Fixed by #42111
Closed
3 tasks done

[Bug]: protocol.handle fails when filename contains '#' #42102

KBriscoe opened this issue May 9, 2024 · 0 comments · Fixed by #42111
Labels
30-x-y component/protocol documentation 📓 has-repro-gist Issue can be reproduced with code at https://gist.github.com/

Comments

@KBriscoe
Copy link

KBriscoe commented May 9, 2024

Preflight Checklist

Electron Version

30.0.2

What operating system are you using?

Windows

Operating System Version

Windows 10 version 22H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The image should display as normal.

Actual Behavior

When you're handling a file:// protocol request, it's being treated like a regular URL. However, the file:// protocol is different from HTTP or HTTPS URLs in how it handles characters like #. In a file:// URL, the # character is typically part of the file or directory name and is not treated as a fragment identifier like in HTTP URLs.

Testcase Gist URL

https://gist.github.com/KBriscoe/550df36cd29a4d27a7672f1404a9e990

Additional Information

If using the gist, the filepaths need to be updated in the renderer.js to actual images. The issue is when the image contains '#' in my case and I looked through the protocol.handle and saw it was treating it like a web request I believe where # usually means to truncate off the rest of the request. So it ends up trying to get an incorrect path item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
30-x-y component/protocol documentation 📓 has-repro-gist Issue can be reproduced with code at https://gist.github.com/
Projects
Status: 🛠️ Fixed for Next Release
Development

Successfully merging a pull request may close this issue.

2 participants