diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-07-08 12:43:49 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-07-10 13:05:03 +0300 |
commit | 5961a8e3077fe8bb6814678a2dc41080712d9e9e (patch) | |
tree | 3b3ff4c7846d704e0602fb1323c78f634c6c5a1d | |
parent | 74fa51387fbc4ac199309f5c0461d4cdde2a1a2f (diff) |
rubyserver: Pass through transaction and Praefect metadata
In order to allow making use of transactions in our Ruby sidecar, we
need to pass through both transaction and Praefect server metadata to
it, in case it exists.
-rw-r--r-- | internal/rubyserver/proxy.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/rubyserver/proxy.go b/internal/rubyserver/proxy.go index 87052c900..f0b8e3f9b 100644 --- a/internal/rubyserver/proxy.go +++ b/internal/rubyserver/proxy.go @@ -7,6 +7,7 @@ import ( "strings" "gitlab.com/gitlab-org/gitaly/internal/helper" + praefect_metadata "gitlab.com/gitlab-org/gitaly/internal/praefect/metadata" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" "google.golang.org/grpc/metadata" ) @@ -62,7 +63,11 @@ func setHeaders(ctx context.Context, repo *gitalypb.Repository, mustExist bool) ) // list of http/2 headers that will be forwarded as-is to gitaly-ruby - proxyHeaderWhitelist := []string{"gitaly-servers"} + proxyHeaderWhitelist := []string{ + "gitaly-servers", + praefect_metadata.TransactionMetadataKey, + praefect_metadata.PraefectMetadataKey, + } if inMD, ok := metadata.FromIncomingContext(ctx); ok { // Automatically whitelist any Ruby-specific feature flag |