Skip to content

Commit 6e9e0d5

Browse files
committed
fix(server): use the whole prefix
REF: https://github.com/GNUWeeb/pgpkeys/pull/34\#issuecomment-1615062326 Signed-off-by: Hazmi Alfarizqi <[email protected]>
1 parent 115c3fa commit 6e9e0d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ export class Server {
88

99
public registerRoutes(): void {
1010
// We currently don't handle Web Key Directory Update Protocol, so empty string is fine.
11-
this.fastify.get("/policy", () => "");
11+
this.fastify.get("/.well-known/openpgpkey/policy", () => "");
1212

13-
this.fastify.head("/hu/:wkdHash", (req, res) => {
13+
this.fastify.head("/.well-known/openpgpkey/hu/:wkdHash", (req, res) => {
1414
const { wkdHash } = req.params as { wkdHash: string };
1515

1616
if (!this.wkd.has(wkdHash)) return res.status(404).send();
1717

1818
return res.status(200).send();
1919
});
2020

21-
this.fastify.get("/hu/:wkdHash", (req, res) => {
21+
this.fastify.get("/.well-known/openpgpkey/hu/:wkdHash", (req, res) => {
2222
const { wkdHash } = req.params as { wkdHash: string };
2323

2424
if (!this.wkd.has(wkdHash)) return res.status(404).send();
@@ -32,7 +32,7 @@ export class Server {
3232
.send(pubKeys.combineBinary());
3333
});
3434

35-
this.fastify.post("/internal/updateHook", (req, res) => updateHook(req, res, this.wkd));
35+
this.fastify.post("/.well-known/openpgpkey/internal/updateHook", (req, res) => updateHook(req, res, this.wkd));
3636
}
3737

3838
public async start(port: number, host = "0.0.0.0"): Promise<any> {

0 commit comments

Comments
 (0)