-
Notifications
You must be signed in to change notification settings - Fork 44
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
/versions header Content-Type
value should be granularized according to RFC requirements in validator
#669
Comments
I would say that the |
I don't know that it makes sense. If it's just returning a |
Well, that's the bit that is now optional... |
The 404 was a red herring, it was always successfully ignoring it (as reported by the log lines following the error). The misleading bit was that the line above showed the wrong request URL (as it is a bit of a fudge to go up one level in base URL inside the validator). If we want content-type to check |
Hmm. I think we should check that the content type is indeed |
Yeah, I agree, I guess I was misinterpreting your comment at the top of the issue:
where "header" in your comment refers to |
Something like that... 😅 But yeah. Misleading title - will fix. |
Content-Type
is OPTIONAL/SHOULDContent-Type
value should be granularized according to RFC requirements
Content-Type
value should be granularized according to RFC requirementsContent-Type
value should be granularized according to RFC requirements in validator
I'm not sure for what use-case we really need to worry about scrapers. If you think you are connecting to an OPTIMADE endpoint, you know exactly what format you expect from Lets try to be very formal about the requirements. For all other endpoints, our header requirements are inherited from the JSON Api specification (MUST be However, one may argue that OPTIMADE must adhere to the HTTP protocol (e.g., section 2 under "Response format"), so as far as I can see, the HTTP RFC is the only thing that formally sets these requirements, and it sets the presence of content-type on SHOULD level. Of course, this doesn't exactly specify whether, IF IT IS INCLUDED, the header MUST be Hence, I'd argue:
|
I honestly don't like this loose approach and the expectation that any client/user simply "knows" the format of endpoints because it's/they've read the specification. I prefer the more automatized approach, where the protocol and standard web content negotiation let's the client/user derive as much information as possible. Especially because the Already using However, in the end, I respect the references you've mentioned above, @rartino, and as such this comment represents more my opinion than anything else. |
For the sake of progress, I've demoted validation of any of the headers for The @rartino is correct that the specification does not really enforce any requirements on content-type, and I don't think it's worth updating the specification with this at this stage. |
Section 5.2 only specifies that what is returned is a subset of the MIME type described by
text/csv; header=present
, I don't see anything I would specifically read as a formal requirement on the content-type parameter in the http headers. The CSV RFC does have a lowercase "should" when discussing the header, and other parts seem to suggest the content-type parameter is optional.Originally posted by @rartino in Materials-Consortia/providers#58 (comment)
The validation check for the header value for
Content-Type
for the/versions
-endpoint seems to not be on a MUST level and should be downgraded in the validator.The text was updated successfully, but these errors were encountered: