Skip to content

Commit c8dc675

Browse files
author
Simon Bernier St-Pierre
committed
Document basic-auth feature
1 parent 2e457da commit c8dc675

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ readme = "README.md"
1414
repository = "https://github.com/sbstp/attohttpc"
1515

1616
[dependencies]
17-
base64 = {version = "0.13", optional=true}
17+
base64 = {version = "0.13", optional = true}
1818
encoding_rs = {version = "0.8", optional = true}
1919
encoding_rs_io = {version = "0.1", optional = true}
2020
flate2 = {version = "1.0", optional = true}
@@ -47,6 +47,7 @@ tokio-stream = {version = "0.1", features = ["net"]}
4747
warp = "0.3"
4848

4949
[features]
50+
basic-auth = ["base64"]
5051
charsets = ["encoding_rs", "encoding_rs_io"]
5152
compress = ["flate2"]
5253
default = ["compress", "tls"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ possible to allow users to get just what they need. Here are the goals of the pr
1616
* Use quality crates from the ecosystem (`http`, `url`, `encoding_rs`), not reinventing the wheel.
1717

1818
## Features
19+
* `basic-auth` support for basic auth
1920
* `charsets` support for decoding more text encodings than just UTF-8
2021
* `compress` support for decompressing response bodies (**default**)
2122
* `json` support for serialization and deserialization

run-tests.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fi
1313
cargo test
1414
cargo test --all-features
1515
cargo test --no-default-features
16+
cargo test --no-default-features --features basic-auth
1617
cargo test --no-default-features --features charsets
1718
cargo test --no-default-features --features compress
1819
cargo test --no-default-features --features form

src/request/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<B> RequestBuilder<B> {
125125
}
126126

127127
/// Enable HTTP basic authentication.
128-
#[cfg(feature = "base64")]
128+
#[cfg(feature = "basic-auth")]
129129
pub fn basic_auth(self, username: impl std::fmt::Display, password: Option<impl std::fmt::Display>) -> Self {
130130
let auth = match password {
131131
Some(password) => format!("{}:{}", username, password),

0 commit comments

Comments
 (0)