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

[NetKAN] Tolerate Malformed Author URLs from KS/SD #1580

Merged
merged 1 commit into from
Feb 25, 2016

Conversation

dbent
Copy link
Member

@dbent dbent commented Feb 13, 2016

From KSP-CKAN/NetKAN#2980. This PR changes the datatype of KerbalStuff's website and source_code properties into String from Uri, since we have no guarantee that they're actually well-formed Uri strings. Now when "normalizing" the URIs (renamed the method from Escape to Normalize since we were doing a lot more in it than merely escaping characters) we do a final check to make sure the string is a well formed URI. If it is, we proceed as normal, if it isn't we spit out a warning and return null, preventing it from being added to the metadata (the SafeAdd extension method will ignore null inputs).

@politas @plague006 @pjf

@mheguy
Copy link
Contributor

mheguy commented Feb 13, 2016

Trying to run the debug output leads to a problem with windows not having curl, and I don't have access to a linux machine to properly build a netkan.exe. If anyone would link one, I'd happily start using/testing it.

KerbalStuff is/was having issues and that was causing netkan to try to use curlsharp (causing my issues).

Here's a debug build if anyone else wants to run it for a couple days and see if any issues emerge: http://www.mediafire.com/download/8q7m9d4fs5x73a4/Debug.zip

Tagging @Olympic1 as a person likely to test this.

@Olympic1
Copy link
Member

Tried out the debug build from @plague006 with KSP-CKAN/NetKAN#2980 and netkan.exe succesfully created a .ckan file without problems. Looking at the debug screen it checks the link and removes the broken link.

Will test further for a couple of days with existing and new netkans.

@mheguy
Copy link
Contributor

mheguy commented Feb 18, 2016

This PR seems moot with recent events, but I have to imagine the changes can, will, and should be applied to spacedock.

@dbent
Copy link
Member Author

dbent commented Feb 18, 2016

Yes, I'll have to update it for Spacedock.

@dbent dbent force-pushed the feature/uri_tolerance branch from 71e70a1 to 1b2ed83 Compare February 21, 2016 15:27
@dbent dbent changed the title [NetKAN] Tolerate Malformed Author URLs from KS [NetKAN] Tolerate Malformed Author URLs from KS/SD Feb 21, 2016
@dbent
Copy link
Member Author

dbent commented Feb 21, 2016

Updated for SpaceDock

@Olympic1
Copy link
Member

Weird, it only added the Kerbalstuff ones, merging manually then.

Olympic1 added a commit that referenced this pull request Feb 25, 2016
[NetKAN] Tolerate Malformed Author URLs from KS/SD
@Olympic1 Olympic1 merged commit 254ef2b into master Feb 25, 2016
@Olympic1 Olympic1 deleted the feature/uri_tolerance branch February 25, 2016 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants