proper string body check
This commit is contained in:
parent
b145d6e538
commit
bb90e7458b
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -103,7 +103,7 @@ function diff(current, checked) {
|
||||||
|
|
||||||
app.post("/updates/:project(\\w+)", (req, res) => {
|
app.post("/updates/:project(\\w+)", (req, res) => {
|
||||||
let project_id = req.params['project'];
|
let project_id = req.params['project'];
|
||||||
const body = String(req.body) || "";
|
const body = (typeof req.body == "string") ? req.body : "";
|
||||||
let adjustedBody = body.replace(/\r/, "");
|
let adjustedBody = body.replace(/\r/, "");
|
||||||
let indexes = get_indexes(project_id);
|
let indexes = get_indexes(project_id);
|
||||||
let difference = diff(indexes, adjustedBody);
|
let difference = diff(indexes, adjustedBody);
|
||||||
|
|
Loading…
Reference in a new issue