When urls are constructed in the Link component, all params are URI
encoded so that they won't break routing. When params are read however,
they are never decoded. This leads to an inconsistent behavior between
the server and the client when params are passed down the page component
as query. On the server, they come down untouched (encoded). On the
client, they are not encoded.
On the server, this page would log "f%2Fg" when navigated to. On the
client it would log "f/g".
By decoding params before they are injected into the query params, we
get the same behavior on the client and the server. We also make the
behavior consistent with how regular query params work.
Coverage increased (+0.03%) to 96.137% when pulling 7f23584d7056a795b7bc25e6061ee993a4f51581 on trotzig:escaped-params into 4630d1961dbf65772fc957bb36a38cbfcb072318 on fridays:master.
When urls are constructed in the
Link
component, all params are URI encoded so that they won't break routing. When params are read however, they are never decoded. This leads to an inconsistent behavior between the server and the client when params are passed down the page component asquery
. On the server, they come down untouched (encoded). On the client, they are not encoded.Consider this link:
and this page component
On the server, this page would log "f%2Fg" when navigated to. On the client it would log "f/g".
By decoding params before they are injected into the
query
params, we get the same behavior on the client and the server. We also make the behavior consistent with how regular query params work.