-
Notifications
You must be signed in to change notification settings - Fork 304
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
Handle Content-Type parameter #1648
Comments
Ah, the error message confused me also, my interpretation of that is that the message body has invalid In the case above, the message body was empty, so it was certainly possible. @bourgeoa right, but it doesn't appear that that function is actually used by the handler. So that seems to be the problem indeed. |
|
@kjetilk "Only text/turtle is supported for RDF" wouldn't be accurate either because as it stands, NSS's rejection of the request may be due to the fact that the media-type value includes a parameter (eg. charset). I think the server should accept Content-Type with parameters. If the server wants to process the message body in context of the parameter, it can do that separately. |
It can be changed. Have you a better proposal ? |
@csarven: yeah, but the intention of that @bourgeoa: I would return an object, where the media type is one property and parameters are other properties, but that wouldn't be backwards compatible I guess. Perhaps it could return an array where the first element is the media type and then parameters as other elements in the array? |
@kjetilk NSS is a filesystem implementation, with contentType stored in filename extension as mimeType. |
I suppose that NSS would like to make sure that everything it stores is UTF-8. Turtle is a special case, since it is required to be UTF-8 by its spec, but thinking generally, I would think that the server might want to re-encode a body before to UTF-8 if it isn't coming in as UTF-8. |
I just had a look over the specs again. Turtle says:
The problem that I think that this was intended to address was that RFC2046 required the default charset for any
which Turtle does. So, it seems that it is now legitimate for a client to skip sending the charset parameter, but RFC6657 was published before the Turtle Recommendation, so I'm not quite sure why they formulated it like that, perhaps to satisfy the SHOULD further down in the RFC. So, in conclusion, it is really important that NSS doesn't reject a request with a query parameter. It is currently not so important to record the charset parameter, but it should do so to ensure that all files are written with UTF-8 in case a client specifies something else. |
https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.1
When a
Content-Type
includes a parameter, for examplecharset
, this errors:https://github.com/solid/node-solid-server/blob/b84789ab03803fff9d7391ad802a9014387716fa/lib/handlers/put.js#L15-L17
Loss of media-type parameters:
https://github.com/solid/node-solid-server/blob/b84789ab03803fff9d7391ad802a9014387716fa/lib/utils.js#L251-L254
The text was updated successfully, but these errors were encountered: