summaryrefslogtreecommitdiff
path: root/workhorse/internal/api/api.go
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-04 18:09:57 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-04 18:09:57 +0000
commitf5a72705e46f835812ffcc51658eecb08fbdf050 (patch)
tree9b322ce9c0454759d5b669be56e603a481791388 /workhorse/internal/api/api.go
parent23c4d0c3e1ea30be08b597a961fc91773f60309f (diff)
downloadgitlab-ce-f5a72705e46f835812ffcc51658eecb08fbdf050.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse/internal/api/api.go')
-rw-r--r--workhorse/internal/api/api.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/workhorse/internal/api/api.go b/workhorse/internal/api/api.go
index d3c19af030d..417ee71dbdc 100644
--- a/workhorse/internal/api/api.go
+++ b/workhorse/internal/api/api.go
@@ -3,7 +3,6 @@ package api
import (
"bytes"
"encoding/json"
- "errors"
"fmt"
"io"
"net/http"
@@ -40,8 +39,6 @@ type API struct {
Version string
}
-var ErrNotGeoSecondary = errors.New("this is not a Geo secondary site")
-
var (
requestsCounter = promauto.NewCounterVec(
prometheus.CounterOpts{
@@ -399,7 +396,6 @@ func validResponseContentType(resp *http.Response) bool {
return helper.IsContentType(ResponseContentType, resp.Header.Get("Content-Type"))
}
-// TODO: Cache the result of the API requests https://gitlab.com/gitlab-org/gitlab/-/issues/329671
func (api *API) GetGeoProxyURL() (*url.URL, error) {
geoProxyApiUrl := *api.URL
geoProxyApiUrl.Path, geoProxyApiUrl.RawPath = joinURLPath(api.URL, geoProxyEndpointPath)
@@ -424,10 +420,6 @@ func (api *API) GetGeoProxyURL() (*url.URL, error) {
return nil, fmt.Errorf("GetGeoProxyURL: decode response: %v", err)
}
- if response.GeoProxyURL == "" {
- return nil, ErrNotGeoSecondary
- }
-
geoProxyURL, err := url.Parse(response.GeoProxyURL)
if err != nil {
return nil, fmt.Errorf("GetGeoProxyURL: Could not parse Geo proxy URL: %v, err: %v", response.GeoProxyURL, err)