Set grpc :authority header from request header (#8912)
This is to fix that the `:authority` header is set to `upstream_balancer`
This commit is contained in:
parent
643c475db0
commit
a21b5218a5
2 changed files with 1 additions and 2 deletions
|
@ -1388,13 +1388,11 @@ stream {
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* By default use vhost as Host to upstream, but allow overrides */}}
|
{{/* By default use vhost as Host to upstream, but allow overrides */}}
|
||||||
{{ if not (eq $proxySetHeader "grpc_set_header") }}
|
|
||||||
{{ if not (empty $location.UpstreamVhost) }}
|
{{ if not (empty $location.UpstreamVhost) }}
|
||||||
{{ $proxySetHeader }} Host {{ $location.UpstreamVhost | quote }};
|
{{ $proxySetHeader }} Host {{ $location.UpstreamVhost | quote }};
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $proxySetHeader }} Host $best_http_host;
|
{{ $proxySetHeader }} Host $best_http_host;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
# Pass the extracted client certificate to the backend
|
# Pass the extracted client certificate to the backend
|
||||||
{{ if not (empty $server.CertificateAuth.CAFileName) }}
|
{{ if not (empty $server.CertificateAuth.CAFileName) }}
|
||||||
|
|
|
@ -120,6 +120,7 @@ var _ = framework.DescribeAnnotation("backend-protocol - GRPC", func() {
|
||||||
|
|
||||||
metadata := res.GetMetadata()
|
metadata := res.GetMetadata()
|
||||||
assert.Equal(ginkgo.GinkgoT(), metadata["content-type"].Values[0], "application/grpc")
|
assert.Equal(ginkgo.GinkgoT(), metadata["content-type"].Values[0], "application/grpc")
|
||||||
|
assert.Equal(ginkgo.GinkgoT(), metadata[":authority"].Values[0], host)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("authorization metadata should be overwritten by external auth response headers", func() {
|
ginkgo.It("authorization metadata should be overwritten by external auth response headers", func() {
|
||||||
|
|
Loading…
Reference in a new issue