1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2025-12-15 10:55:07 +00:00

Add dnt-policy.txt

This commit is contained in:
Cadence Fish
2020-03-04 01:32:09 +13:00
parent 51e85e6bb9
commit fbe9583988
3 changed files with 239 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
const fs = require("fs")
const pj = require("path").join
const {render} = require("pinski/plugins")
const constants = require("../../lib/constants")
module.exports = [
{route: "/\\.well-known/dnt-policy\\.txt", methods: ["GET"], code: async () => {
if (constants.does_not_track) {
return {
statusCode: 200,
contentType: "text/plain",
stream: fs.createReadStream(pj(__dirname, "../html/.well-known/dnt-policy.txt"))
}
} else {
return render(404, "pug/404.pug")
}
}}
]