fix: encodeURI before fetching

This commit is contained in:
Adam Pash 2016-09-15 14:25:22 -04:00
parent 1343469b6c
commit 4cdc4165d6

View File

@ -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