Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

HTTP Client is using an invalid JSON MIME type #62

Open
markusju opened this issue May 2, 2020 · 4 comments
Open

HTTP Client is using an invalid JSON MIME type #62

markusju opened this issue May 2, 2020 · 4 comments

Comments

@markusju
Copy link

markusju commented May 2, 2020

Currently HTTP Requests to a RPKI validation server are made with the header option "Accept: text/json".
This is causing issues with APIs of some RPKI servers that are particularly picky about this. For example the /api/objects/validated endpoint of RIPE NCC's rpki-validator-3 does not like "text/json".

"text/json" is not a valid MIME type after all and should be changed to "application/json", possibly avoiding issues with future implementations of RPKI validation servers. (rfc8259)

@markusju
Copy link
Author

markusju commented May 2, 2020

Well, I just tried patching this, which turned out to be really easy.
=> Search and replace "text/json" with "application/json".

However, it turns out /api/objects/validated in rpki-validator-3 does not produce data in a proper schema (yet) for gortr. This is another issue which I have raised at this project.

Nevertheless the MIME type is invalid and should most likely be corrected to avoid future incompatibilities.

@lspgn
Copy link
Contributor

lspgn commented May 4, 2020

I believe the "text/json" was for ripe-rpki-validator 2 but I may be wrong. I can make it available as a CLI argument.
I agree on the rest, there is no standard at the moment, and the ASNs format has been changed from "AS65001" to a JSON integer.

Which version of GoRTR are you using? Could you share the JSON file as well?

@ties
Copy link
Contributor

ties commented May 5, 2020

I believe the "text/json" was for ripe-rpki-validator 2 but I may be wrong. I can make it available as a CLI argument.
I agree on the rest, there is no standard at the moment, and the ASNs format has been changed from "AS65001" to a JSON integer.

Perhaps standardising this format (and the headers) would be good.

In my eyes a RPKI validation server should not be intolerant of Content-Types however, in practice, if code is implemented in a framework that has dynamic handling of MIME types they will be.

lspgn added a commit that referenced this issue Jun 9, 2020
@lspgn
Copy link
Contributor

lspgn commented Jun 9, 2020

Made a change to application/json by default but client can configure the Accept header.

lspgn added a commit that referenced this issue Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants