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

Inconsistent use of base64 encoding for names in resource links. #4

Open
PhonicUK opened this issue Dec 8, 2016 · 1 comment
Open
Labels

Comments

@PhonicUK
Copy link

PhonicUK commented Dec 8, 2016

Where the list of links associated with resources is a key:value pair, some of the keys are base64 encoded and others are not. Example at https://api.spiget.org/v2/resources/269

Either base64 should be always used, or those which need base64 as a way to escape the data should carry a "base64:" tag at the front of the string to denote this.

@InventivetalentDev
Copy link
Member

Good point.

The ones without Base64 existed first, and are always discussion, additionalInformation and alternativeSupport, since they don't have any special characters (https://github.com/SpiGetOrg/SpigetParser/blob/master/src/main/java/org/spiget/parser/ResourcePageParser.java#L75).
Also those which are Base64-Encoded contain the custom links on the resource page (https://github.com/SpiGetOrg/SpigetParser/blob/master/src/main/java/org/spiget/parser/ResourcePageParser.java#L48).

I'm currently not sure about how to (if at all) change that without messing with existing clients, I might end up moving all custom (Base64) links to a separate array in the response.
But for now, it's probably easier for you to just check for the 3 definite keys that aren't encoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants