netconf-wg / restconf

9 stars 4 forks source link

URI encoding issues #27

Closed kwatsen closed 8 years ago

kwatsen commented 9 years ago

Reported by Nick Weeds:

Section 3.5.1: Quoting and URI-encoding key values in URIs

Section 3.5.1 says that key values in URIs should be both quoted and URI-encoded (percent-encoded).
However, it doesn't explain the quoting rules or the relationship between the two encoding steps.

Applying two levels of encoding (quoting then URI encoding) seems complicated - why not omit quoting and just use URI encoding ?

What are the quoting rules for quote and other special characters in the key value ?

Should key value be quoted and then URI encoded ?

What would the URI look like if the key value contained the following characters: comma, single-quote, double-quote, colon, slash, space ?

And also:

URI-encoding in D.3.3

Most of the examples in appendix D use URI-encoding (percent-encoding) for characters outside the unreserved set, but the URI in section D.3.3 does not.
Should the reserved characters /;() in this URI be URI-encoded, or is the use of unencoded characters deliberate ?
nickweeds commented 9 years ago

One of the bullets in section 3.5.1 page 20 says:

Quoted strings are supported in the key leaf values. Quoted strings MUST be used to express empty strings. (example: list=foo,'',baz).

It's the encoding rules for these quoted strings that isn't clear to me.

abierman commented 9 years ago

I am changing this bullet to get rid of quoted strings in key leafs

Add following text for percent-encoding example

The following example shows how reserved characters are percent-encoded within a key value. The value of 'key1' contains a comma, single-quote, double-quote, colon, space, and forward slash. (,'": /). Note that the angle brackets ('<', '>'), and double-quote ('"') are not reserved characters and do not need to be percent-encoded.

Example URL:

/restconf/data/example-top:top/list2=key1/X

/restconf/data/example-top:top/list2=%2C%27"%3A%20%2F/X

abierman commented 8 years ago

closed in restconf--09