aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-08-04 20:34:09 -0700
committerAdam Soltys <[email protected]>2020-08-04 20:34:09 -0700
commit1ac57d2081cf05b82ad0e9982e4b3a013f43a961 (patch)
tree145f238080f1612bc2f9e7920f9f729b576e31ed
parente07ea0075cd02c74c7e68b7e19093a47db5bb16d (diff)
downloadcoinos-server-1ac57d2081cf05b82ad0e9982e4b3a013f43a961.tar.gz
coinos-server-1ac57d2081cf05b82ad0e9982e4b3a013f43a961.zip
don't cache error responses
-rw-r--r--index.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/index.js b/index.js
index bd09ae1b..cad45728 100644
--- a/index.js
+++ b/index.js
@@ -11,7 +11,9 @@ l = require("pino")();
config = require("./config");
networks = [];
prod = process.env.NODE_ENV === "production";
-fail = (msg) => { throw new Error(msg) };
+fail = (msg) => {
+ throw new Error(msg);
+};
challenge = {};
logins = {};
@@ -23,7 +25,7 @@ if (config.liquid) networks.push("liquid");
if (config.lna) networks.push("lightning");
SATS = 100000000;
-toSats = n => parseInt((n * SATS).toFixed());
+toSats = (n) => parseInt((n * SATS).toFixed());
app = express();
app.enable("trust proxy");
@@ -60,13 +62,16 @@ app.use((err, req, res, next) => {
path: req.path,
body: req.body,
msg: err.message,
- stack: err.stack
+ stack: err.stack,
};
if (req.user) details.username = req.user.username;
l.error("Error: ", err.message);
res.status(500);
+ res.set({
+ "Cache-Control": "no-cache",
+ });
res.send(err.message);
return res.end();
});
@@ -74,4 +79,3 @@ app.use((err, req, res, next) => {
server.listen(config.port, () =>
console.log(`CoinOS Server listening on port ${config.port}`)
);
-