diff options
author | Carlos Yu <carlosy@indeed.com> | 2022-08-05 15:55:42 +0000 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2022-08-05 15:55:42 +0000 |
commit | 15e7e01ef05f9ef72c72a82217267837ca1beaa7 (patch) | |
tree | 71703ab2db8de8f4abc4433bcbb5454da376a0c8 /client/client_test.go | |
parent | 8f2a4e90923a852eb386885b9379d5953fd8781b (diff) | |
download | gitlab-shell-15e7e01ef05f9ef72c72a82217267837ca1beaa7.tar.gz |
Fixed extra slashes in API request paths generated for geo
Diffstat (limited to 'client/client_test.go')
-rw-r--r-- | client/client_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/client/client_test.go b/client/client_test.go index 37f7d3c..e91d3da 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -77,6 +77,7 @@ func TestClients(t *testing.T) { testAuthenticationHeader(t, client) testJWTAuthenticationHeader(t, client) testXForwardedForHeader(t, client) + testHostWithTrailingSlash(t, client) }) } } @@ -237,6 +238,16 @@ func testXForwardedForHeader(t *testing.T, client *GitlabNetClient) { }) } +func testHostWithTrailingSlash(t *testing.T, client *GitlabNetClient) { + oldHost := client.httpClient.Host + client.httpClient.Host = oldHost + "/" + + testSuccessfulGet(t, client) + testSuccessfulPost(t, client) + + client.httpClient.Host = oldHost +} + func buildRequests(t *testing.T, relativeURLRoot string) []testserver.TestRequestHandler { requests := []testserver.TestRequestHandler{ { |