Fix issue with double slashes in URL #31
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
index.ts
,sourceBaseUrl
gets a"/"
added at the end if not already present, but infindCollectables
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).