Fix double-absolute SpaceDock URLs #3466
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.
Problem
After KSP-SpaceDock/SpaceDock#388, lots and lots of SpaceDock mods had their
resources.x_screenshot
property updated to start withhttps://spacedock.info/https://spacedock.info/
:KSP-CKAN/CKAN-meta@2de283f...bea11c1
Cause
The SpaceDock mod API used to return
background
as a relative URL, and now it's absolute. Netkan has code to convert it from relative to absolute unconditionally, so now it's double-absolute.Changes
JsonConvertFromRelativeSdUri
converter is removed fromSpacedockMod.background
JsonConvertFromRelativeSdUri
class is moved to its own fileSpaceDockApi.ExpandPath
is moved intoJsonConvertFromRelativeSdUri
and made privateSpacedockMod.GetPageUrl
is refactored to account forExpandPath
now being privateTests.SDMod.SD_URL_encode_816
is refactored to test URL processing as part of full parsing of mod JSON rather than just the now-privateExpandPath
Now the absolute URL from SpaceDock will be used as-is, so most of those commits should revert after merge.