Skip to content

Commit

Permalink
Resolve lint error in server\server.js file
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavik001 committed Dec 11, 2023
1 parent 476306a commit 5fcca99
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ function handleRequest(request, response) {
response.writeHead(301, headers);
response.end();
} else if (parts.length === 2 && parsedUrl.pathname.indexOf(".") === -1) {
// eslint-disable-next-line no-redeclare
var boardName = validateBoardName(parts[1]);
boardName = validateBoardName(parts[1]);
jwtBoardName.checkBoardnameInToken(parsedUrl, boardName);
boardTemplate.serve(request, response, isModerator);
// If there is no dot and no directory, parts[1] is the board name
Expand All @@ -138,12 +137,11 @@ function handleRequest(request, response) {
break;

case "download":
// eslint-disable-next-line no-redeclare
var boardName = validateBoardName(parts[1]),
history_file = path.join(
config.HISTORY_DIR,
"board-" + boardName + ".json",
);
boardName = validateBoardName(parts[1]);
var history_file = path.join(
config.HISTORY_DIR,
"board-" + boardName + ".json",
);
jwtBoardName.checkBoardnameInToken(parsedUrl, boardName);
// eslint-disable-next-line no-useless-escape
if (parts.length > 2 && /^[0-9A-Za-z.\-]+$/.test(parts[2])) {
Expand All @@ -163,13 +161,11 @@ function handleRequest(request, response) {

case "export":
case "preview":
// eslint-disable-next-line no-redeclare
var boardName = validateBoardName(parts[1]),
// eslint-disable-next-line no-redeclare
history_file = path.join(
(boardName = validateBoardName(parts[1])),
(history_file = path.join(
config.HISTORY_DIR,
"board-" + boardName + ".json",
);
));
jwtBoardName.checkBoardnameInToken(parsedUrl, boardName);
response.writeHead(200, {
"Content-Type": "image/svg+xml",
Expand Down

0 comments on commit 5fcca99

Please sign in to comment.