Skip to content

Commit

Permalink
fix: use encode/decodeURIComponent (#10183)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed May 15, 2023
1 parent d388a6e commit d0c68ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/puppeteer-core/src/common/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class PuppeteerURL {
const [functionName = '', siteString = ''] = url.split(';');
const puppeteerUrl = new PuppeteerURL();
puppeteerUrl.#functionName = functionName;
puppeteerUrl.#siteString = globalThis.atob(siteString);
puppeteerUrl.#siteString = decodeURIComponent(siteString);
return puppeteerUrl;
};

Expand All @@ -204,9 +204,10 @@ export class PuppeteerURL {
}

toString(): string {
return `pptr:${[this.#functionName, globalThis.btoa(this.#siteString)].join(
';'
)}`;
return `pptr:${[
this.#functionName,
encodeURIComponent(this.#siteString),
].join(';')}`;
}
}

Expand Down

0 comments on commit d0c68ff

Please sign in to comment.