mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 16:46:55 +00:00
test(admin): cover site replication absolute URI endpoint (#2745)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -3128,6 +3128,18 @@ mod tests {
|
|||||||
assert_eq!(endpoint, "https://node-a.example.com:9000");
|
assert_eq!(endpoint, "https://node-a.example.com:9000");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_request_endpoint_uses_absolute_uri_without_host_header() {
|
||||||
|
let uri: Uri = "https://node-a.example.com:9443/rustfs/admin/v3/site-replication/status"
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
|
let headers = HeaderMap::new();
|
||||||
|
|
||||||
|
let endpoint = request_endpoint(&uri, &headers);
|
||||||
|
|
||||||
|
assert_eq!(endpoint, "https://node-a.example.com:9443");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_request_endpoint_falls_back_to_https_when_tls_path_is_configured() {
|
fn test_request_endpoint_falls_back_to_https_when_tls_path_is_configured() {
|
||||||
with_var(ENV_RUSTFS_TLS_PATH, Some("/tmp/tls"), || {
|
with_var(ENV_RUSTFS_TLS_PATH, Some("/tmp/tls"), || {
|
||||||
|
|||||||
Reference in New Issue
Block a user