From 552ef3d9929b449cc4c587f28716f7b9f72eef65 Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Fri, 3 May 2019 13:19:33 +0000 Subject: [PATCH] fix(static): always return entry path for 404 errors --- static.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static.js b/static.js index c8133c44..64140158 100644 --- a/static.js +++ b/static.js @@ -45,7 +45,7 @@ function error(message, code = 500) { 'Content-Type': 'text/html', 'X-Static': 'Raw/Static', }, - body: `Error ${code}: ${message}`, + body: `${message}`, }; } @@ -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); }); }