File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ func (s *Server) Authmiddleware(next http.Handler) http.Handler {
8888 secret := s .webhookSecret
8989
9090 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
91- signature := r .Header .Get ("X-Signature" )
91+ signature := r .Header .Get ("X-Webhook- Signature" )
9292 if signature == "" {
9393 http .Error (w , "Missing signature header" , http .StatusUnauthorized )
9494 return
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ func (s *ServerSuite) TestAuthMiddleware() {
133133 validSignature := hex .EncodeToString (mac .Sum (nil ))
134134
135135 req := httptest .NewRequest ("POST" , "/userli" , bytes .NewBuffer (payload ))
136- req .Header .Set ("X-Signature" , validSignature )
136+ req .Header .Set ("X-Webhook- Signature" , validSignature )
137137
138138 rr := httptest .NewRecorder ()
139139 wrappedHandler := s .server .Authmiddleware (http .HandlerFunc (handler ))
@@ -145,7 +145,7 @@ func (s *ServerSuite) TestAuthMiddleware() {
145145 s .Run ("invalid token" , func () {
146146 payload := []byte (`{"dummy":"data"}` )
147147 req := httptest .NewRequest ("POST" , "/userli" , bytes .NewBuffer (payload ))
148- req .Header .Set ("X-Signature" , "invalid-signature" )
148+ req .Header .Set ("X-Webhook- Signature" , "invalid-signature" )
149149
150150 rr := httptest .NewRecorder ()
151151 wrappedHandler := s .server .Authmiddleware (http .HandlerFunc (handler ))
You can’t perform that action at this time.
0 commit comments