Automattic / Automattic/juice

Problem with escaping URLs

Open
#325 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.3k
Forks
233
Avg merge
1d 10h
Merged PRs (30d)
8

Description

I'm trying to run juice.juiceResources on the url `https://www.adlibris.com/se/bok/happy-food-20-om-hur-maltiden-och-lyckan-hanger-ihop-9789188745040`

But I'm getting this error:

```
Error: The file /var/pricefinder/https:/s3.adlibris.com/dist/41cf43d50b259cd5c6202cd2bff95eb651046e00/dist/41cf43d50b259cd5c6202cd2bff95eb651046e00/material-icons.ttf was not found!
```

> **note:** the single slash after `https:`

Looking at https://s3.adlibris.com/dist/41cf43d50b259cd5c6202cd2bff95eb651046e00/globals.css (which is from the original url) the following code is present:

```
@font-face{font-family:material-icons;src:url(/dist/41cf43d50b259cd5c6202cd2bff95eb651046e00/material-icons.ttf) format("truetype"),url(/dist/41cf43d50b259cd5c6202cd2bff95eb651046e00/material-icons.woff) format("woff"),url(/dist/41cf43d50b259cd5c6202cd2bff95eb651046e00/material-icons.svg#material-icons) format("svg");
```

Seems like the base url gets escaped (the double slash)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with juice.juiceResources using the URL in the report, then trace how the referenced globals.css resource paths are resolved. Check the handling of the https:// base URL and confirm that the font paths no longer become local paths containing only one slash after https:.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.