mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-09-28 23:07:30 +00:00
19 lines
497 B
JavaScript
19 lines
497 B
JavaScript
|
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")
|
||
|
}
|
||
|
}}
|
||
|
]
|