Skip to content

Commit 2827c3a

Browse files
committed
feat(securitytxt): add security.txt
1 parent 2cbb113 commit 2827c3a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/browser/security.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Contact: mailto:[email protected]
2+
Acknowledgments: https://coder.com/security/thanks
3+
Preferred-Languages: en-US
4+
Canonical: https://coder.com/.well-known/security.txt
5+
Policy: https://coder.com/security/policy
6+
Hiring: https://coder.com/careers

src/node/routes/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
8181
return res.redirect(`https://${req.headers.host}${req.originalUrl}`)
8282
}
8383

84+
// Return security.txt.
85+
if ((req.originalUrl === "/security.txt") || (req.originalUrl === "/.well-known/security.txt")) {
86+
const resourcePath = path.resolve(rootPath, "src/browser/security.txt")
87+
res.set("Content-Type", getMediaMime(resourcePath))
88+
return res.send(await fs.readFile(resourcePath))
89+
}
90+
91+
8492
// Return robots.txt.
8593
if (req.originalUrl === "/robots.txt") {
8694
const resourcePath = path.resolve(rootPath, "src/browser/robots.txt")

0 commit comments

Comments
 (0)