mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
app/vmauth: verify how backend response headers are propagated to vmauth client
This commit is contained in:
parent
d53dd6ecf3
commit
83f2ce4910
@ -71,6 +71,10 @@ unauthorized_user:
|
|||||||
url_prefix: {BACKEND}/foo?bar=baz`
|
url_prefix: {BACKEND}/foo?bar=baz`
|
||||||
requestURL := "http://some-host.com/abc/def?some_arg=some_value"
|
requestURL := "http://some-host.com/abc/def?some_arg=some_value"
|
||||||
backendHandler := func(w http.ResponseWriter, r *http.Request) {
|
backendHandler := func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
h := w.Header()
|
||||||
|
h.Set("Connection", "close")
|
||||||
|
h.Set("Foo", "bar")
|
||||||
|
|
||||||
var bb bytes.Buffer
|
var bb bytes.Buffer
|
||||||
if err := r.Header.Write(&bb); err != nil {
|
if err := r.Header.Write(&bb); err != nil {
|
||||||
panic(fmt.Errorf("unexpected error when marshaling headers: %w", err))
|
panic(fmt.Errorf("unexpected error when marshaling headers: %w", err))
|
||||||
@ -79,6 +83,7 @@ unauthorized_user:
|
|||||||
}
|
}
|
||||||
responseExpected := `
|
responseExpected := `
|
||||||
statusCode=200
|
statusCode=200
|
||||||
|
Foo: bar
|
||||||
requested_url={BACKEND}/foo/abc/def?bar=baz&some_arg=some_value
|
requested_url={BACKEND}/foo/abc/def?bar=baz&some_arg=some_value
|
||||||
Pass-Header: abc
|
Pass-Header: abc
|
||||||
User-Agent: vmauth
|
User-Agent: vmauth
|
||||||
|
Loading…
Reference in New Issue
Block a user