Skip to content

Commit c3deead

Browse files
committed
Fix PAT Scope middleware for unhandled requests & add GraphQL-Features header constant
1 parent 4c1ad6b commit c3deead

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/http/middleware/pat_scope.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ func WithPATScopes(logger *slog.Logger, scopeFetcher scopes.FetcherInterface) fu
4141

4242
next.ServeHTTP(w, r.WithContext(ctx))
4343
}
44+
45+
next.ServeHTTP(w, r)
4446
}
4547
return http.HandlerFunc(fn)
4648
}

pkg/http/transport/graphql_features.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strings"
66

77
ghcontext "github.com/github/github-mcp-server/pkg/context"
8+
"github.com/github/github-mcp-server/pkg/http/headers"
89
)
910

1011
// GraphQLFeaturesTransport is an http.RoundTripper that adds GraphQL-Features
@@ -44,7 +45,7 @@ func (t *GraphQLFeaturesTransport) RoundTrip(req *http.Request) (*http.Response,
4445

4546
// Check for GraphQL-Features in context and add header if present
4647
if features := ghcontext.GetGraphQLFeatures(req.Context()); len(features) > 0 {
47-
req.Header.Set("GraphQL-Features", strings.Join(features, ", "))
48+
req.Header.Set(headers.GraphQLFeaturesHeader, strings.Join(features, ", "))
4849
}
4950

5051
return transport.RoundTrip(req)

0 commit comments

Comments
 (0)