-
Query parameter parsing quiz: https://example.com/?url=https://example.com/first/?url=https://example.com/second/ In the above, the value of the
url
query parameter is equal to: 1️⃣ https://example.com/first/?url=https://example.com/second/ 2️⃣ https://example.com/second/ -
Follow up: it’s #1! You can check this behavior using
(new URL("example.com/?url=https://example.com/first/?url=https://example.com/second/")).searchParams.get("url")
Better: UseencodeURIComponent
to encode the param and make this irrelevant. More from @patmeenan: @patmeenan/1377301255970770946