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

Fix issue with double slashes in URL #31

Merged
merged 2 commits into from
Feb 7, 2022
Merged

Fix issue with double slashes in URL #31

merged 2 commits into from
Feb 7, 2022

Conversation

essential-randomness
Copy link
Contributor

In index.ts, sourceBaseUrl gets a "/" added at the end if not already present, but in findCollectables the url is defined as ${sourceBaseUrl}/${d}, causing a double slash in URLs.

The URLs in the current examples do not trigger an error when multiple forward slashes are present. For example, this is a valid URL: https://raw.githubusercontent.com/PowerShell/PowerShell/master////////////README.md

I added an example that does trigger an error using the GitHub API for the issue labels in this same repository: https://api.github.com/repos/rdilweb/docusaurus-plugin-remote-content/labels.

This also serves as a way to document how to use this plugin for fetching data from this API, as it requires responseType: "arraybuffer" in its config to work (or it's interpreted as a JSON array, which cannot be serialized to file using the current method).

@RDIL
Copy link
Member

RDIL commented Feb 7, 2022

Looks good, thank you!

@RDIL RDIL merged commit 2441f03 into rdilweb:main Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants