Fix invalid http signature

Date header could be inconsistent with the date included in the
signature
pull/5138/head
Chocobozzz 2022-07-15 11:06:27 +02:00
parent 4fdc735020
commit 319f9670bf
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 6 additions and 3 deletions

View File

@ -85,11 +85,14 @@ const peertubeGot = got.extend({
}
httpSignature.signRequest({
getHeader: function (header) {
return options.headers[header]
getHeader: function (header: string) {
const value = options.headers[header.toLowerCase()]
if (!value) logger.warn('Unknown header requested by http-signature.', { headers: options.headers, header })
return value
},
setHeader: function (header, value) {
setHeader: function (header: string, value: string) {
options.headers[header] = value
},