Skip to content

Commit

Permalink
fix some lint (style) errors
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Dec 17, 2024
1 parent 24249a0 commit 5f05ddd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/mockotlpserver/lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ function diagChFromReqUrl(reqUrl) {
}

// helper functions
function badRequest(res, errMsg='Invalid or no data received', errCode=400) {
function badRequest(
res,
errMsg = 'Invalid or no data received',
errCode = 400
) {
res.writeHead(400);
res.end(
JSON.stringify({
Expand Down Expand Up @@ -133,7 +137,10 @@ class HttpService extends Service {
this._server = http.createServer((req, res) => {
const contentType = req.headers['content-type'];
if (!parsersMap[contentType]) {
return badRequest(res, `unexpected request Content-Type: "${contentType}"`)
return badRequest(
res,
`unexpected request Content-Type: "${contentType}"`
);
}

const chunks = [];
Expand All @@ -154,7 +161,7 @@ class HttpService extends Service {
let resBody = null;
if (contentType === 'application/json') {
resBody = JSON.stringify({
ok: 1
ok: 1,
});
}
res.writeHead(200);
Expand Down

0 comments on commit 5f05ddd

Please sign in to comment.