-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Environment
Erlang/OTP 23 [erts-11.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Elixir 1.10.4 (compiled with Erlang/OTP 21)
Synopsis
We have a rich media parser (OpenGraph, Twittercards, etc) which encountered an issue. The code discussed likely exists because some sites on the internet are providing relative URLs in their OGP/Twittercard metadata. We should do more validation before blindly merging, but this problem could still be encountered.
Current behavior
page_url = "https://www.macrumors.com/guide/apps-support-apples-spatial-audio-feature/"
image_url = "https://images.macrumors.com/t/4riJyi1XC906qyJ41nAfOgpvo1I=/1600x/https://images.macrumors.com/article-new/2020/09/spatialaudiofeature.jpg"
page_url_data = URI.parse(page_url)
image_url_data = URI.parse(image_url)
merged_data = URI.merge(page_url_data, image_url_data)
image_url_data.path == merged_data.path
false
Expected behavior
true
Conclusion
URL to the image was changed from:
to
Note, there is a missing /
in the https://
embedded in the URL's path
lanodan
Metadata
Metadata
Assignees
Labels
No labels