Skip to content

Commit

Permalink
Return empty object for missing urls.json/etc in API server
Browse files Browse the repository at this point in the history
  • Loading branch information
CapacitorSet committed Mar 22, 2018
1 parent 34b21c1 commit 03bb7f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integrations/api/api.js
Expand Up @@ -280,7 +280,7 @@ app.get("/sample/:id/urls", async (req, res) => {

const file = path.join(outputFolder, "sample.js.results", "urls.json");
if (!await p(fs.exists)(file)) {
res.json({server_err: 3});
res.send("[]");
return;
}

Expand Down Expand Up @@ -308,7 +308,7 @@ app.get("/sample/:id/resources", async (req, res) => {

const file = path.join(outputFolder, "sample.js.results", "resources.json");
if (!await p(fs.exists)(file)) {
res.json({server_err: 3});
res.send("{}");
return;
}

Expand Down Expand Up @@ -336,7 +336,7 @@ app.get("/sample/:id/snippets", async (req, res) => {

const file = path.join(outputFolder, "sample.js.results", "snippets.json");
if (!await p(fs.exists)(file)) {
res.json({server_err: 3});
res.send("[]");
return;
}

Expand Down Expand Up @@ -364,7 +364,7 @@ app.get("/sample/:id/ioc", async (req, res) => {

const file = path.join(outputFolder, "sample.js.results", "IOC.json");
if (!await p(fs.exists)(file)) {
res.json({server_err: 3});
res.send("[]");
return;
}

Expand Down

0 comments on commit 03bb7f2

Please sign in to comment.