[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [odata] [OASIS Issue Tracker] (ODATA-1539) Clarify decoding of plus character in URLs
From
http://en.wikipedia.org/wiki/URL_encoding: Space as plus should use mime type:
application/x-www-form-urlencoded. George -----Original Message----- [EXTERNAL EMAIL] Ralf Handl created ODATA-1539: --------------------------------- Summary: Clarify decoding of plus character in URLs Key: ODATA-1539 URL:
https://urldefense.com/v3/__https://issues.oasis-open.org/browse/ODATA-1539__;!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQZfjVihUQ$ [issues[.]oasis-open[.]org] Project: OASIS Open Data Protocol (OData) TC Issue Type: Improvement Components: URL Conventions Affects Versions: V4.01_OS Reporter: Ralf Handl Fix For: V4.01_ERRATA01 OData URL is based on [RFC3986|https://urldefense.com/v3/__https://www.rfc-editor.org/rfc/rfc3986.html__;!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQZr-_nveA$ [rfc-editor[.]org]],
which in [Section 2.1 Percent-Encoding|https://urldefense.com/v3/__https://www.rfc-editor.org/rfc/rfc3986.html*section-2.1__;Iw!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQZJUrhH_A$ [rfc-editor[.]org]]
explicitly defines {{%20}} as the encoding for space. Unfortunately RFC3986 is less clear on the encoding of the plus ({{+}}) character: [Section 2.2 Reserved Characters|https://urldefense.com/v3/__https://www.rfc-editor.org/rfc/rfc3986.html*section-2.2__;Iw!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQZiunV5LA$
[rfc-editor[.]org]] recommends {{%2B}} as the encoding for plus “unless […] specifically allowed by the URI scheme to represent data in that component”. As a consequence, many URL-encoding tools, and the most commonly used browsers (Chrome, Edge, Firefox) do not percent-encode the plus character and retain it as a plus character. To make matters really confusing the [WhatWG URL|https://urldefense.com/v3/__https://url.spec.whatwg.org/__;!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQYswJF3Dg$ [url[.]spec[.]whatwg[.]org]] specification
defines an API for manipulating URLs that - depending on how it is used - will encode space as the the plus ({{+}}) character: {code:js} var x = new URL("https://urldefense.com/v3/__http://foo?bar=a*b__;Kw!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQa5ztgyzA$
[foo] c") x.href // -->
https://urldefense.com/v3/__http://foo/?bar=a*b*20c__;KyU!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQZ6OketkQ$ [foo] var y = new URL("https://urldefense.com/v3/__http://foo__;!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQadjJnwNA$
[foo]") y.searchParams.append("bar","a+b c") y.href // -->
https://urldefense.com/v3/__http://foo/?bar=a*2Bb*c__;JSs!!LpKI!hHdcWzFpTAtIHwBVrhEjf_pmiYBc1HNJJ5F3H9RF1tDQjrNC6VJYcP1Um9DNRgu2SWRXdZD0uCuBMm7VHgBrXFTQTZ1doQbqO9s1sA$ [foo] {code} This raises the question on how an OData service SHOULD / MUST interpret the plus ({{+}}) character in a URL: * does it mean plus, * or does it mean space? Note: the percent-encoded variants are unambiguous: * {{%20}} means space * {{%2B}} means plus -- This message was sent by Atlassian Jira (v8.3.3#803004) --------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at: |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]