feat(securitytxt): add security.txt (#5827)
This commit is contained in:
parent
df49838739
commit
b6adcf50c6
6
src/browser/security.txt
Normal file
6
src/browser/security.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Contact: mailto:security@coder.com
|
||||||
|
Acknowledgments: https://coder.com/security/thanks
|
||||||
|
Preferred-Languages: en-US
|
||||||
|
Canonical: https://coder.com/.well-known/security.txt
|
||||||
|
Policy: https://coder.com/security/policy
|
||||||
|
Hiring: https://coder.com/careers
|
@ -81,6 +81,13 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
return res.redirect(`https://${req.headers.host}${req.originalUrl}`)
|
return res.redirect(`https://${req.headers.host}${req.originalUrl}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return security.txt.
|
||||||
|
if (req.originalUrl === "/security.txt" || req.originalUrl === "/.well-known/security.txt") {
|
||||||
|
const resourcePath = path.resolve(rootPath, "src/browser/security.txt")
|
||||||
|
res.set("Content-Type", getMediaMime(resourcePath))
|
||||||
|
return res.send(await fs.readFile(resourcePath))
|
||||||
|
}
|
||||||
|
|
||||||
// Return robots.txt.
|
// Return robots.txt.
|
||||||
if (req.originalUrl === "/robots.txt") {
|
if (req.originalUrl === "/robots.txt") {
|
||||||
const resourcePath = path.resolve(rootPath, "src/browser/robots.txt")
|
const resourcePath = path.resolve(rootPath, "src/browser/robots.txt")
|
||||||
|
Reference in New Issue
Block a user