Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
fix(static): always return entry path for 404 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed May 3, 2019
1 parent b986733 commit 552ef3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion static.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function error(message, code = 500) {
'Content-Type': 'text/html',
'X-Static': 'Raw/Static',
},
body: `Error ${code}: ${message}`,
body: `${message}`,
};
}

Expand Down Expand Up @@ -281,6 +281,9 @@ function deliverPlain(owner, repo, ref, entry, root, esi = false) {
body: entry,
};
}
if (rqerror.statusCode==404) {
return error(entry, rqerror.statusCode);
}
return error(rqerror.response.body.toString(), rqerror.statusCode);
});
}
Expand Down

0 comments on commit 552ef3d

Please sign in to comment.