Skip to content

Commit 94e8e48

Browse files
authored
Add feature to use http scheme (#17)
2 parents ffe9833 + fb0249b commit 94e8e48

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ There are a lot of various features that enable a wide variety of use cases, ref
4949
+ `default` - only `fail-on-err`
5050
+ `fail-on-err` - `panic` on any error
5151
+ `no-verify-ssl` - disable SSL verification for endpoints, useful for custom regions
52+
+ `http` - enable http scheme (disabled by default)
5253

5354
### Path or subdomain style URLs and headers
5455

s3/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ default = ["fail-on-err"]
8787
no-verify-ssl = []
8888
fail-on-err = []
8989
tracing = ["dep:tracing"]
90+
http = []
9091

9192
[dev-dependencies]
9293
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "fs"] }

s3/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ There are a lot of various features that enable a wide variety of use cases, ref
4949
+ `default` - only `fail-on-err`
5050
+ `fail-on-err` - `panic` on any error
5151
+ `no-verify-ssl` - disable SSL verification for endpoints, useful for custom regions
52+
+ `http` - enable http scheme (disabled by default)
5253

5354
### Path or subdomain style URLs and headers
5455

s3/src/bucket/client.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ pub fn create_client(
2626
https_connector.with_webpki_roots()
2727
};
2828

29-
let https_connector = https_connector.https_only().enable_http2().build();
29+
let https_connector = if cfg!(feature = "http") {
30+
https_connector.https_or_http().enable_http2().build()
31+
} else {
32+
https_connector.https_only().enable_http2().build()
33+
};
3034

3135
let mut timeout_connector = TimeoutConnector::new(https_connector);
3236
timeout_connector.set_connect_timeout(request_timeout);

0 commit comments

Comments
 (0)