Marked sensitive headers as such in docs (#1160)
This commit is contained in:
@@ -405,7 +405,12 @@ impl ClientBuilder {
|
||||
/// use reqwest::header;
|
||||
/// # async fn doc() -> Result<(), reqwest::Error> {
|
||||
/// let mut headers = header::HeaderMap::new();
|
||||
/// headers.insert(header::AUTHORIZATION, header::HeaderValue::from_static("secret"));
|
||||
/// headers.insert("X-MY-HEADER", header::HeaderValue::from_static("value"));
|
||||
///
|
||||
/// // Consider marking security-sensitive headers with `set_sensitive`.
|
||||
/// let mut auth_value = header::HeaderValue::from_static("secret");
|
||||
/// auth_value.set_sensitive(true);
|
||||
/// headers.insert(header::AUTHORIZATION, auth_value);
|
||||
///
|
||||
/// // get a client builder
|
||||
/// let client = reqwest::Client::builder()
|
||||
@@ -422,7 +427,7 @@ impl ClientBuilder {
|
||||
/// use reqwest::header;
|
||||
/// # async fn doc() -> Result<(), reqwest::Error> {
|
||||
/// let mut headers = header::HeaderMap::new();
|
||||
/// headers.insert(header::AUTHORIZATION, header::HeaderValue::from_static("secret"));
|
||||
/// headers.insert("X-MY-HEADER", header::HeaderValue::from_static("value"));
|
||||
///
|
||||
/// // get a client builder
|
||||
/// let client = reqwest::Client::builder()
|
||||
@@ -430,7 +435,7 @@ impl ClientBuilder {
|
||||
/// .build()?;
|
||||
/// let res = client
|
||||
/// .get("https://www.rust-lang.org")
|
||||
/// .header(header::AUTHORIZATION, "token")
|
||||
/// .header("X-MY-HEADER", "new_value")
|
||||
/// .send()
|
||||
/// .await?;
|
||||
/// # Ok(())
|
||||
|
||||
Reference in New Issue
Block a user