page.query not properly encoding params #1179
Description
Describe the bug
page.query not properly encoding/decoding params
Logs
https://www.amazon.com/Electronic-Arts-Titanfall-Instant-Access/dp/B01H0LFN3K/ref=as_li_ss_tl?ascsub=
To Reproduce
Pass in an encoded url with parameters to /?link=<encoded-url-here>
Use this url: https://www.amazon.com/Electronic-Arts-Titanfall-Instant-Access/dp/B01H0LFN3K/ref=as_li_ss_tl?&ascsub&linkCode=sl1&tag=foo-20&linkId=394efa83730b482f01461894f50da53f&language=en_US
it should be /?link=encodeURIComponent(url)
when you send it
Expected behavior
<script context="module">
export async function preload(page, session) {
let scoops
const { title, link, text, category } = page.query;
console.log(link);
if (text) scoops = 'text';
return { title, link, text, category, scoops };
}
</script>
console.log(link) here does not have any parameters after it.
Information about your Sapper Installation:
Ubuntu 18.04
"sapper": "^0.27.0",
Severity
I'd say not properly handling encoded url parameters is a major bug
Additional context
Add any other context about the problem here.
Demo link of issue:
https://coupondeals.life/compose?link=https%3A%2F%2Fwww.amazon.com%2FElectronic-Arts-Titanfall-Instant-Access%2Fdp%2FB01H0LFN3K%2Fref%3Das_li_ss_tl%3F%26ascsub%26linkCode%3Dsl1%26tag%3Dfoo-20%26linkId%3D394efa83730b482f01461894f50da53f%26language%3Den_US