VictoriaMetrics/app/vmauth
Aliaksandr Valialkin add2db12b2
app/vmauth: properly proxy HTTP requests without body
The Request.Body for requests without body can be nil. This could break readTrackingBody.Read() logic,
which could incorrectly return "cannot read data after closing the reader" error in this case.
Fix this by initializing the readTrackingBody.r with zeroReader.

While at it, properly set Host header if it is specified in 'headers' section.
It must be set net/http.Request.Host instead of net/http.Request.Header.Set(),
since the net/http.Client overwrites the Host header with the value from req.Host
before sending the request.

While at it, add tests for requestHandler(). Additional tests for various requestHandler() cases
will be added in future commits.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6445
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5707
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5240
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6525
2024-07-19 16:24:12 +02:00
..
deployment
multiarch deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
auth_config_test.go app/vmauth: properly proxy HTTP requests without body 2024-07-19 16:24:12 +02:00
auth_config.go app/vmauth: properly proxy HTTP requests without body 2024-07-19 16:24:12 +02:00
example_config_ent.yml vmauth: add browser authorization request for http requests without… (#5234) 2023-11-01 20:59:46 +01:00
example_config.yml app/vmauth: adds metric_labels and backend_errors counter (#5585) 2024-01-21 04:40:52 +02:00
main_test.go app/vmauth: properly proxy HTTP requests without body 2024-07-19 16:24:12 +02:00
main.go app/vmauth: properly proxy HTTP requests without body 2024-07-19 16:24:12 +02:00
Makefile Add build support for loong64 (#6222) 2024-05-09 14:22:03 +02:00
README.md all: replace old https://docs.victoriametrics.com/vmauth.html url with the new one - https://docs.victoriametrics.com/vmauth/ 2024-04-18 01:49:41 +02:00
target_url_test.go app/vmauth: properly handle the case when zero backend hosts are resolved at SRV DNS 2024-07-17 11:31:05 +02:00
target_url.go app/vmauth: follow-up for b155b20de4 2024-04-17 14:27:52 +02:00

See vmauth docs here.

vmauth docs can be edited at docs/vmauth.md.