[whatwg/url] Percent sign missing from application/x-www-urlencoded percent encode set (#600)

When the name or value of a tuple in Steps 3.1 and 3.4 of the [application/x-www-form-urlencoded serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer) algorithm contain a percent sign, it gets appended literally, instead of being percent encoded. This happens because the percent sign is not in the [application/x-www-form-urlencoded percent-encode set](https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set), and as a result, the percent sign is appended without being percent encoded in Step 5.3.5 of [percent-encode after encoding](https://url.spec.whatwg.org/#string-percent-encode-after-encoding). This is causing a few test failures [[1]](https://github.com/web-platform-tests/wpt/blob/master/url/urlsearchparams-stringifier.any.js#L77) and [[2]](https://github.com/web-platform-tests/wpt/blob/master/url/urlsearchparams-stringifier.any.js#L115) where the tests expect the percent sign to be percent encoded.

I'm not sure if this was an intentional change. Previously, this used the [application/x-www-form-urlencoded byte serializer](https://whatpr.org/url/518/19494f1...91bead4.html#urlencoded-serializing), which did percent encode the percent sign.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/600

Received on Saturday, 15 May 2021 21:53:28 UTC