Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

page.query not properly encoding params #1179

Open
ralyodio opened this issue May 2, 2020 · 1 comment
Open

page.query not properly encoding params #1179

ralyodio opened this issue May 2, 2020 · 1 comment
Labels

Comments

@ralyodio
Copy link

ralyodio commented May 2, 2020

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

@ralyodio
Copy link
Author

has anyone had a chance to look at this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants