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

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...

@therealgilles therealgilles force-pushed the fix/decodeURI-encodeURI branch from 4871893 to db160b1 Compare February 2, 2021 19:00
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 therealgilles force-pushed the fix/decodeURI-encodeURI branch from db160b1 to e25a12b Compare February 2, 2021 19:01
@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