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(())
|
||||
|
||||
@@ -141,8 +141,14 @@ impl ClientBuilder {
|
||||
/// use reqwest::header;
|
||||
/// # fn build_client() -> Result<(), reqwest::Error> {
|
||||
/// let mut headers = header::HeaderMap::new();
|
||||
/// headers.insert("X-MY-HEADER", header::HeaderValue::from_static("value"));
|
||||
/// headers.insert(header::AUTHORIZATION, header::HeaderValue::from_static("secret"));
|
||||
///
|
||||
/// // 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::blocking::Client::builder()
|
||||
/// .default_headers(headers)
|
||||
@@ -158,7 +164,7 @@ impl ClientBuilder {
|
||||
/// use reqwest::header;
|
||||
/// # fn build_client() -> 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::blocking::Client::builder()
|
||||
@@ -166,7 +172,7 @@ impl ClientBuilder {
|
||||
/// .build()?;
|
||||
/// let res = client
|
||||
/// .get("https://www.rust-lang.org")
|
||||
/// .header(header::AUTHORIZATION, "token")
|
||||
/// .header("X-MY-HEADER", "new_value")
|
||||
/// .send()?;
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
|
||||
Reference in New Issue
Block a user