Closed EskoDijk closed 5 years ago
Hi Esko,
I prefer 4.00, 4.15 Unsupported Content-Format suggests the presence of a content-format option.
Peter Esko Dijk schreef op 2019-01-30 11:22:
Section 5.4: "In case a required COAP option (i.e Content-Format) is omitted, the server is expected to return a 4.02." This is not possible in CoAP, only malformed Options or well-formed but unrecognized Critical Options can cause a 4.02. Absence of an option must not cause 4.02.
One example of a missing option can be a missing Content-Format Option in a POST request. In this case, 4.15 Unsupported Content-Format seems a better choice. Other missing Options we don't have to specify I think, one can rely on the general CoAP RFC7252 rules for CoAP servers. A server would return 4.00 Bad Request if the request is unusable due to a missing Option.
-- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2].
[1] https://github.com/SanKumar2015/EST-coaps/issues/112 [2] https://github.com/notifications/unsubscribe-auth/AMWTQXKOv3bXSaNGCZVbnA8PnBgHiv7Hks5vIXJ8gaJpZM4aZ447
This text was referring to a Content-Format that the client requested with an Accept. @csosto-pk to address this.
Rephrased to
In case a COAP option is unrecognized or unsafe, the server is expected to return a 4.02 (Bad Option). If the Content_Format requested in the client Accept Option, is not supported the server MUST return a 4.06 (Not Acceptable), unless another error code takes precedence for the response.
An Option being Unsafe (=Unsafe-to-forward) alone does not trigger a 4.02 response; only Options that are both unrecognized and Unsafe that are processed by a Proxy lead to 4.02. In a server endpoint (not proxy), an Option that is both unrecognized and critical leads to a 4.02. (Elective Options that are unrecognized never lead to a 4.02.
So the first sentence could be updated to e.g.: (assuming we describe a server not proxy) In case a COAP Option is unrecognized and critical, the server is expected to return a 4.02 (Bad Option).
Good catch. Fixed. Text now reads
In case a CoAP Option is unrecognized and critical, the server is expected to return a 4.02 (Bad Option).
Section 5.4: "In case a required COAP option (i.e Content-Format) is omitted, the server is expected to return a 4.02." This is not possible in CoAP, only malformed Options or well-formed but unrecognized Critical Options can cause a 4.02. Absence of an option must not cause 4.02.
One example of a missing option can be a missing Content-Format Option in a POST request. In this case, 4.15 Unsupported Content-Format seems a better choice. Other missing Options we don't have to specify I think, one can rely on the general CoAP RFC7252 rules for CoAP servers. A server would return 4.00 Bad Request if the request is unusable due to a missing Option.