Skip to content

Commit

Permalink
fix(fixDevel): send real request with full URL with crumb
Browse files Browse the repository at this point in the history
(crumb is stripped from url for cache id)
  • Loading branch information
gadicc committed Jul 24, 2023
1 parent 0a4a061 commit 2911f36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/fetchDevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async function fetchDevel(url, fetchOptions) {
);

// Remove crumb param to have consistent cacheable URLs
const origUrl = url;
url = url.replace(/[?&]crumb=[^?&]+/, "");

// If devel===true, hash the url, otherwise use the value of devel
Expand All @@ -69,7 +70,7 @@ async function fetchDevel(url, fetchOptions) {
contentObj = JSON.parse(contentJson);
} catch (error) {
if (error.code === "ENOENT") {
const res = await nodeFetch(url, fetchOptions);
const res = await nodeFetch(origUrl, fetchOptions);

contentObj = {
request: {
Expand Down

0 comments on commit 2911f36

Please sign in to comment.