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

Resolve relative URLS getting changed to absolute URLS #92

Closed
manpreet2760 opened this issue Aug 23, 2020 · 1 comment
Closed

Resolve relative URLS getting changed to absolute URLS #92

manpreet2760 opened this issue Aug 23, 2020 · 1 comment

Comments

@manpreet2760
Copy link

Hello,

I am currently using that package for one of my work and facing an issue that relative URLs in HTML are getting resolved to absolute URLs.

URL: https://spiritualtactics.com/

After some trial and error found out that if the following function in index.js (Line : 140)
rewriteHtmlUrls({ $, url, headers })

is comment out then the downloaded HTML contains relative URLs.

Request your assistance in solving this issue. As I want to have the downloaded HTML unmodified i.e. if the URLs in the original HTML is absolute it should be absolute else if it is relative, then the downloaded should have relative.

Thanks

@Kikobeats
Copy link
Member

Hello,

I added rewriteUrls parameter for enabling the ability to rewrite relative to absolute URLs.

It's false by default, so if you use the latest version, your problem should be fixed and you don't need to do anything additional 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants