From 72cfdaf2be42c9e77d4c9c2491ce393f1943c711 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Wed, 10 Jun 2020 23:07:54 +0200 Subject: [PATCH] fix: explicit disable prerender --- src/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index 04d93d4..96dba22 100644 --- a/src/index.js +++ b/src/index.js @@ -45,12 +45,12 @@ const fetch = (url, { reflect = false, toEncode, ...opts }) => return reflect ? resolve({ isRejected: true, error }) : resolve({ - url, - html: '', - mode: 'fetch', - headers: error.response ? error.response.headers : {}, - statusCode: error.response ? error.response.statusCode : undefined - }) + url, + html: '', + mode: 'fetch', + headers: error.response ? error.response.headers : {}, + statusCode: error.response ? error.response.statusCode : undefined + }) } }) @@ -102,11 +102,11 @@ const prerender = async ( return isFetchResRejected ? { - headers: data.headers || {}, - html: '', - url, - mode: 'prerender' - } + headers: data.headers || {}, + html: '', + url, + mode: 'prerender' + } : data } @@ -116,7 +116,7 @@ const isFetchMode = url => autoDomains.includes(getDomainWithoutSuffix(url)) const determinateMode = (url, { prerender }) => { if (prerender === false || isMediaUrl(url)) return 'fetch' - if (prerender !== 'auto') return 'prerender' + if (prerender === true) return 'prerender' return isFetchMode(url) ? 'fetch' : 'prerender' }