Skip to content

Commit

Permalink
fix: use proper port
Browse files Browse the repository at this point in the history
Signed-off-by: dovholuknf <46322585+dovholuknf@users.noreply.github.com>
  • Loading branch information
dovholuknf committed Mar 22, 2024
1 parent 117d3ca commit 2ae8ba2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/handler/registercenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ func (rh *ResourceHandler) getAclTokenOfConsul(w http.ResponseWriter, r *http.Re
sp := bootstrapContainer.SecretProviderExtFrom(rh.dic.Get)
var url string
if sp.IsZeroTrustEnabled() {
url = fmt.Sprintf("http://%s:%d%s", config.Registry.Host, config.APIGateway.ApplicationPort, AclOfConsulPathDirect)
url = fmt.Sprintf("http://%s:%d%s", config.Registry.Host, config.Registry.Port, AclOfConsulPathDirect)
} else {
url = fmt.Sprintf("http://%s:%d%s", config.APIGateway.Server, config.APIGateway.ApplicationPort, AclOfConsulPathProxied)
}

req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return "", err, http.StatusUnauthorized
Expand Down Expand Up @@ -125,6 +125,7 @@ func (rh *ResourceHandler) RegistryIsAlive(w http.ResponseWriter, r *http.Reques
return
}
}

client, err := rh.registryCenterClient(token)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
Expand Down

0 comments on commit 2ae8ba2

Please sign in to comment.