handle copy-pasting images when there is CORS#738
Open
GaboHBeaumont wants to merge 2 commits into
Open
Conversation
Collaborator
|
Ok so this fix is only meant to help the bug on desktop? |
Collaborator
Author
|
You are right! It only fixed Desktop.. I pushed a fix for web too. |
ericvicenti
reviewed
Jun 10, 2026
| } | ||
| } | ||
|
|
||
| function isPrivateAddress(address: string) { |
Collaborator
There was a problem hiding this comment.
this is kind of a red flag, indicates a larger security issue with this approach. Probably we should not have this web-file interface at all. The client should request the file and upload it normally.
Is this intended as a sort of CORS bypass?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes rich HTML paste from webpages where copied content includes remote images that are blocked by renderer-side CORS fetches.
Instead of trying to fetch remote
http/httpsimage URLs directly in the paste plugin, the editor now lets those images go through the normal HTML paste flow. That allows the existing desktopimportWebFilepath to import the images through the app/backend path, avoiding browser CORS restrictions.Changes
Files when they are local browser sources:data:blob:http://...https://...importWebFileinto additionalCommentEditorsurfaces:CommentEditor.Why
Copying from pages like https://xanadu.com/zigzag/ can put remote image references into the clipboard HTML. The previous paste path tried to fetch those image URLs from the renderer, which fails when the source site does not send permissive CORS headers.
This caused paste to fail with errors like: