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 double-absolute SpaceDock URLs #3466

Merged
merged 1 commit into from Oct 20, 2021

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Oct 20, 2021

Problem

After KSP-SpaceDock/SpaceDock#388, lots and lots of SpaceDock mods had their resources.x_screenshot property updated to start with https://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

  • The JsonConvertFromRelativeSdUri converter is removed from SpacedockMod.background
  • The JsonConvertFromRelativeSdUri class is moved to its own file
  • SpaceDockApi.ExpandPath is moved into JsonConvertFromRelativeSdUri and made private
  • SpacedockMod.GetPageUrl is refactored to account for ExpandPath now being private
  • Tests.SDMod.SD_URL_encode_816 is refactored to test URL processing as part of full parsing of mod JSON rather than just the now-private ExpandPath

Now the absolute URL from SpaceDock will be used as-is, so most of those commits should revert after merge.

@HebaruSan HebaruSan added Bug Pull request Netkan Issues affecting the netkan data labels Oct 20, 2021
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this fixed again!

@DasSkelett DasSkelett merged commit ff3f495 into KSP-CKAN:master Oct 20, 2021
@HebaruSan HebaruSan deleted the fix/netkan-sd-urls branch October 20, 2021 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Netkan Issues affecting the netkan data Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants