mirror of
https://github.com/postlight/mercury-parser
synced 2024-11-17 03:25:31 +00:00
fix: encodeURI before fetching
This commit is contained in:
parent
1343469b6c
commit
4cdc4165d6
@ -76,13 +76,13 @@ export function baseDomain({ host }) {
|
|||||||
// unicode content for HTML, with charset conversion.
|
// unicode content for HTML, with charset conversion.
|
||||||
|
|
||||||
export default async function fetchResource(url) {
|
export default async function fetchResource(url) {
|
||||||
const parsedUrl = URL.parse(url);
|
const parsedUrl = URL.parse(encodeURI(url));
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
url: parsedUrl,
|
url: parsedUrl,
|
||||||
headers: { ...REQUEST_HEADERS },
|
headers: { ...REQUEST_HEADERS },
|
||||||
timeout: FETCH_TIMEOUT,
|
timeout: FETCH_TIMEOUT,
|
||||||
// Don't set encoding; this fixes issues
|
// Don't set encoding; fixes issues
|
||||||
// w/gzipped responses
|
// w/gzipped responses
|
||||||
encoding: null,
|
encoding: null,
|
||||||
// Accept cookies
|
// Accept cookies
|
||||||
|
Loading…
Reference in New Issue
Block a user