OCMapZoneIdToLinkLocalEndpoint (in ocstack.c) percent-encodes the IPv6
address included in the OCEndpointPayload of an OCResourcePayload struct:

                        if (OC_STACK_OK == OCGetLinkLocalZoneId(ifindex,
&zoneId))
                        {
                            assert(zoneId != NULL);
                            // put zoneId to end of addr
                            OICStrcat(eps->addr, OC_MAX_ADDR_STR_SIZE,
"%25");
                            OICStrcat(eps->addr, OC_MAX_ADDR_STR_SIZE,
zoneId);
                            OICFree(zoneId);
                        }

As I understand it such encoding is only there for e.g. browsers. It is not
needed in CoAP messages, where addressing info is formatted such that no
percent-encoding is needed.  Percent encoding the endpoint address forces
clients to percent-decode the endpoint in order to use it in e.g. a GET
request. That smells fishy to me. Using a percent-encoded address in
OCDoRequest fails.

RFC 66874 "updates the URI syntax specification [RFC3986
<https://tools.ietf.org/html/rfc3986>] by

   adding syntax to allow a zone identifier to be included in a literal
   IPv6 address **within a URI**." (emphasis added).


The addr field of OCEndpointPayload is not a URI, hence should not be
percent-encoded.


What am I missing?

Gregg
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to