Skip to content

Commit 90ece3c

Browse files
fix: prevent browser content type sniffing
1 parent 2cc042e commit 90ece3c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

virtool/api/headers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77

88
@middleware
99
async def headers_middleware(req, handler):
10-
"""Middleware that adds the current version of the API to the response."""
10+
"""Middleware that appends static headers to the response."""
1111
resp = await handler(req)
1212
resp.headers["X-Virtool-Version"] = req.app["version"]
1313
resp.headers["Server"] = "Virtool"
14+
resp.headers["X-Content-Type-Options"] = "nosniff"
1415

1516
return resp
1617

0 commit comments

Comments
 (0)