Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Fix url encoding when fetching remote assets #453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

therealgilles
Copy link

@therealgilles therealgilles commented Feb 2, 2021

Use url.parse(fileUrl).href instead of decodeURI/encodeURI to properly encode the url if necessary.
This fixes the issue where an avatar url was getting double-encoded.

@therealgilles
Copy link
Author

Oops, how did I not see the conflict between the url package and the url var, fix coming...

Use url.parse(fileUrl).href instead of decodeURI/encodeURI to properly
encode the url if necessary.

This fixes the issue where an avatar url was getting double-encoded.
@therealgilles
Copy link
Author

I used const urlParse = require('url').parse to avoid the conflict with existing url variables. Let me know if it's undesirable. If so, feel free to suggest an alternative names for either the library variable or the existing url variables.

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

Successfully merging this pull request may close these issues.

1 participant