diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-12 10:42:25 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-12 16:29:32 +0100 |
commit | 797d05bdd99b63104522051d0f61f1e0f003e780 (patch) | |
tree | a0e356958e03aa62c4539afacbf7715eba305954 /server/helpers | |
parent | 2a9562fc5894509e63016b1fe09f6dce0c4b6e5e (diff) | |
download | PeerTube-797d05bdd99b63104522051d0f61f1e0f003e780.tar.gz PeerTube-797d05bdd99b63104522051d0f61f1e0f003e780.tar.zst PeerTube-797d05bdd99b63104522051d0f61f1e0f003e780.zip |
Force signed headers in http signatures
Thanks Roger
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/peertube-crypto.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts index 1655cd7b5..994f725d8 100644 --- a/server/helpers/peertube-crypto.ts +++ b/server/helpers/peertube-crypto.ts | |||
@@ -50,7 +50,11 @@ function isHTTPSignatureVerified (httpSignatureParsed: any, actor: MActor): bool | |||
50 | } | 50 | } |
51 | 51 | ||
52 | function parseHTTPSignature (req: Request, clockSkew?: number) { | 52 | function parseHTTPSignature (req: Request, clockSkew?: number) { |
53 | return httpSignature.parse(req, { clockSkew }) | 53 | const headers = req.method === 'POST' |
54 | ? HTTP_SIGNATURE.REQUIRED_HEADERS.POST | ||
55 | : HTTP_SIGNATURE.REQUIRED_HEADERS.ALL | ||
56 | |||
57 | return httpSignature.parse(req, { clockSkew, headers }) | ||
54 | } | 58 | } |
55 | 59 | ||
56 | // JSONLD | 60 | // JSONLD |