diff options
Diffstat (limited to 'internal/testhelper/requesthandlers/requesthandlers.go')
-rw-r--r-- | internal/testhelper/requesthandlers/requesthandlers.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/testhelper/requesthandlers/requesthandlers.go b/internal/testhelper/requesthandlers/requesthandlers.go index 6d501d0..2fdaef6 100644 --- a/internal/testhelper/requesthandlers/requesthandlers.go +++ b/internal/testhelper/requesthandlers/requesthandlers.go @@ -29,6 +29,14 @@ func BuildDisallowedByApiHandlers(t *testing.T) []testserver.TestRequestHandler } func BuildAllowedWithGitalyHandlers(t *testing.T, gitalyAddress string) []testserver.TestRequestHandler { + return buildAllowedWithGitalyHandlers(t, gitalyAddress, false) +} + +func BuildAllowedWithGitalyHandlersWithSidechannel(t *testing.T, gitalyAddress string) []testserver.TestRequestHandler { + return buildAllowedWithGitalyHandlers(t, gitalyAddress, true) +} + +func buildAllowedWithGitalyHandlers(t *testing.T, gitalyAddress string, useSidechannel bool) []testserver.TestRequestHandler { requests := []testserver.TestRequestHandler{ { Path: "/api/v4/internal/allowed", @@ -56,6 +64,9 @@ func BuildAllowedWithGitalyHandlers(t *testing.T, gitalyAddress string) []testse }, }, } + if useSidechannel { + body["gitaly"].(map[string]interface{})["use_sidechannel"] = true + } require.NoError(t, json.NewEncoder(w).Encode(body)) }, }, |