fix: use host with potential port for instance context (#7022)

This commit is contained in:
Livio Spring 2023-12-06 18:53:41 +02:00 committed by GitHub
parent a87f54b328
commit 6f3afb810d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ func hostFromOrigin(ctx context.Context) (host string, err error) {
if err != nil {
return "", err
}
host = u.Hostname()
host = u.Host
if host == "" {
err = errors.New("empty host")
}

View File

@ -221,7 +221,7 @@ func Test_setInstance(t *testing.T) {
r.Header.Set("host", "fromrequest")
return r.WithContext(zitadel_http.WithComposedOrigin(r.Context(), "https://fromorigin:9999"))
}(),
verifier: &mockInstanceVerifier{"fromorigin"},
verifier: &mockInstanceVerifier{"fromorigin:9999"},
headerName: "host",
},
res{