OpenMobileAlliance / OMA_LwM2M_for_Developers

OMA LightweightM2M public resources.
http://openmobilealliance.github.io/OMA_LwM2M_for_Developers/
Other
239 stars 52 forks source link

Accept option for operations which do not expect content in result #241

Closed kFYatek closed 5 years ago

kFYatek commented 7 years ago

During the Warsaw TestFest, there was a certain server which included an Accept CoAP option in every request sent to the client - including operations such as Execute, even though the client is not supposed to respond with any content payload. Specifically, the POST request representing the Execute operation contained an Accept: text/plain option.

The LwM2M 1.0.1 TS refers to the Accept option as a possible option for Reads and as a mandatory option identifying the Discover operation (compare sections 8.2.3 and 8.2.5). However, it does not say anything about this option being present in other kinds of operations.

Section 8.1 reads:

The Accept Option MAY be included in a LwM2M Server data request, to specify the payload Content-Format this Server prefers to receive. The Client returns the preferred Content-Format if available. [...] If the preferred Content-Format cannot be returned, then a 4.06 “Not Acceptable” value MUST be sent as a response.

Similar wording is also used in RFC 7252, section 5.10.4.

Since the response to the Execute operation does not include any payload, it may be argued that "Content-Format of text/plain cannot be returned" by the client in response. On the other hand, the client does not need to use any conflicting format, so the expected response without any content is not in direct violation of what the server requests.

All in all, the question is: Is it legal for the LwM2M server to include the Accept option in requests which are not supposed to be responded to with any payload at all, such as Execute?

hannestschofenig commented 5 years ago

Is it legal for the LwM2M server to include the Accept option in requests which are not supposed to be responded to with any payload at all, such as Execute?

Yes. It is not an error but also not explicitly supported. Furthermore, this is an IETF CoAP issue rather than an OMA LwM2M issue.