Skip to content

Commit

Permalink
Pass request verb correctly seems to be only sometimes in request inf…
Browse files Browse the repository at this point in the history
…o. (#118)

Would need more debugging
  • Loading branch information
bastjan authored Mar 3, 2023
1 parent 8c70dc0 commit 8b28f6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apiserver/authwrapper/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"strings"

apierrors "k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
Expand Down Expand Up @@ -255,7 +256,7 @@ func (s *authorizedStorage) NewConnectOptions() (runtime.Object, bool, string) {
func (s *authorizedStorage) Connect(ctx context.Context, name string, options runtime.Object, responder rest.Responder) (http.Handler, error) {
if c, ok := s.storage.(rest.Connecter); ok {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
if err := s.authorizer.AuthorizeContext(ctx); err != nil {
if err := s.authorizer.AuthorizeVerb(ctx, strings.ToLower(req.Method), name); err != nil {
responder.Error(err)
return
}
Expand Down

0 comments on commit 8b28f6a

Please sign in to comment.