[GH-ISSUE #3696] [Bug] Images from URL return "invalid URL" if URL contains extra arguments. #1676

Closed
opened 2026-03-23 21:15:51 +00:00 by mirror · 6 comments
Owner

Originally created by @TDuffinNTU on GitHub (Oct 13, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/3696

Bug Description

https://images.pexels.com/photos/732444/pexels-photo-732444.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2

Take the above image URL from pexels. It'll open in a browser tab just fine, and is the result of copying the link to an image on the site. However, in Appflowy the image doesn't apply as the URL is "invalid". Removing the arguments makes the image work fine.

image

How to Reproduce

Copy an image from pexels, unsplash, etc. using "copy link to image" or "copy image url" in your browser.

Example: https://images.pexels.com/photos/732444/pexels-photo-732444.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2

Attempt to set it as your document's cover photo with the image from URL feature:

image

Expected Behavior

Image is detected and loaded.

Operating System

Windows

AppFlowy Version(s)

0.3.5

Screenshots

As above.

Additional Context

Possibly failing because the Uri parser is expecting an image file extension such as .jpg? We had some issues with this on our own apps and found that making a get request to the URI and parsing the returned content-type in the response header was a good indicator of whether the link contained the document type we were expecting.

Originally created by @TDuffinNTU on GitHub (Oct 13, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/3696 ### Bug Description https://images.pexels.com/photos/732444/pexels-photo-732444.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2 Take the above image URL from pexels. It'll open in a browser tab just fine, and is the result of copying the link to an image on the site. However, in Appflowy the image doesn't apply as the URL is "invalid". Removing the arguments makes the image work fine. ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/43959652/12241475-408e-4a0e-ad40-ae8b687bf361) ### How to Reproduce Copy an image from pexels, unsplash, etc. using "copy link to image" or "copy image url" in your browser. Example: https://images.pexels.com/photos/732444/pexels-photo-732444.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2 Attempt to set it as your document's cover photo with the image from URL feature: ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/43959652/98ce5985-90ae-4131-a0af-ff86017f0fcc) ### Expected Behavior Image is detected and loaded. ### Operating System Windows ### AppFlowy Version(s) 0.3.5 ### Screenshots As above. ### Additional Context Possibly failing because the Uri parser is expecting an image file extension such as .jpg? We had some issues with this on our own apps and found that making a get request to the URI and parsing the returned content-type in the response header was a good indicator of whether the link contained the document type we were expecting.
Author
Owner

@DevaanshPathak commented on GitHub (Oct 20, 2023):

@MayurSMahajan I want to work on this please assign it to me.

<!-- gh-comment-id:1772336645 --> @DevaanshPathak commented on GitHub (Oct 20, 2023): @MayurSMahajan I want to work on this please assign it to me.
Author
Owner

@MayurSMahajan commented on GitHub (Oct 20, 2023):

Assigned. Have fun !

<!-- gh-comment-id:1772339471 --> @MayurSMahajan commented on GitHub (Oct 20, 2023): Assigned. Have fun !
Author
Owner

@DevaanshPathak commented on GitHub (Oct 28, 2023):

It is a kind of SQL injection to be exact I am working on the uri parser for it to just expect img extensions and ignore the extra attributes.

<!-- gh-comment-id:1783642983 --> @DevaanshPathak commented on GitHub (Oct 28, 2023): It is a kind of SQL injection to be exact I am working on the uri parser for it to just expect img extensions and ignore the extra attributes.
Author
Owner

@annieappflowy commented on GitHub (Dec 21, 2023):

@DevaanshPathak , still working on this? need help?

<!-- gh-comment-id:1866821618 --> @annieappflowy commented on GitHub (Dec 21, 2023): @DevaanshPathak , still working on this? need help?
Author
Owner

@DevaanshPathak commented on GitHub (Dec 24, 2023):

@annieappflowy I was working on it until yesterday but am unable to find a fix. Working on open source code is not as easy as it sounds.

<!-- gh-comment-id:1868540715 --> @DevaanshPathak commented on GitHub (Dec 24, 2023): @annieappflowy I was working on it until yesterday but am unable to find a fix. Working on open source code is not as easy as it sounds.
Author
Owner

@Xazin commented on GitHub (Mar 2, 2024):

Since this issue was created, a lot has changed for the document cover, and I can't reproduce on MacOS anymore.

I'm going to close this for now, we can reopen or create a new issue if still needed.

<!-- gh-comment-id:1974893071 --> @Xazin commented on GitHub (Mar 2, 2024): Since this issue was created, a lot has changed for the document cover, and I can't reproduce on MacOS anymore. I'm going to close this for now, we can reopen or create a new issue if still needed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#1676
No description provided.