Skip to content

Commit

Permalink
Understand HEAD right
Browse files Browse the repository at this point in the history
  • Loading branch information
Leslie-Wong-H committed Sep 14, 2024
1 parent a85facb commit 11a4ccd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export default async (req, res) => {
searchFile = req.rawBody;
} else if (req.method === "HEAD") {
await logAndDequeue(knex, redis, uid, priority, 204);
// Note: the client side can not recive the json object because of HEAD
return res.status(204).json({
error: "HEAD method acknowledged",
});
Expand Down
1 change: 0 additions & 1 deletion src/search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ describe("invalid input", () => {
async () => {
const response = await request(app).head("/search");
expect(response.statusCode).toBe(204);
expect(typeof response.body.error).toBe("string");
},
1000 * 10
);
Expand Down

0 comments on commit 11a4ccd

Please sign in to comment.