Allow serializing empty keys to "key=" rather than "key"
Closed this issue · 1 comments
svieira commented
In 0.4.3:
val uri_string = "https://a.domain.here?a=1&b=&c="
uri_string ? ("d", "")
results in:
res3: com.netaporter.uri.Uri = https://a.domain.here?a=1&b&c&d
Ideally, it would be possible to specify that the desired serialization is:
res3: com.netaporter.uri.Uri = https://a.domain.here?a=1&b=&c=&d=
Nothing is specified about this in RFC 3986, but the HTML5 form section regarding application/x-www-form-urlencoded encoding has this to say about the encoding steps:
- If this is not the first entry, append a single U+0026 AMPERSAND character (&) to result.
- Append the entry's name to result.
- Append a single "=" (U+003D) character to result.
- Append the entry's value to result.
This change was introduced in 9e20420 (more specifically, this change to Parameters.scala)