From ef61eef06ed03ecd3e8d89a1ff9c77dba2df3446 Mon Sep 17 00:00:00 2001 From: Tommaso Barbugli Date: Fri, 14 Apr 2017 14:46:04 +0200 Subject: [PATCH] Date is not a mandatory header > 2.3. Signature String Construction > > In order to generate the string that is signed with a key, the client > MUST use the values of each HTTP header field in the `headers` > Signature parameter, in the order they appear in the `headers` > Signature parameter. It is out of scope for this document to dictate > what header fields an application will want to enforce, but > implementers SHOULD at minimum include the request target and Date > header fields. https://tools.ietf.org/html/draft-cavage-http-signatures --- signature.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/signature.go b/signature.go index 53c38bc..afb7d63 100644 --- a/signature.go +++ b/signature.go @@ -132,10 +132,6 @@ func (s *Signature) sign(key string, r *http.Request) error { // IsValid validates this signature for the given key func (s Signature) IsValid(key string, r *http.Request) bool { - if !s.Headers.hasDate() { - return false - } - sig, err := s.calculateSignature(key, r) if err != nil { return false