authorization.rs
Rust test marker or harnessimports base64::decode
SHA-2566b7e5acd4989cb35333c95ecd32231159ad0be6f94fb2cdd867eb7698022f8d8
MaleculeO(As)H(Cm₂)Md₂(In₂Pa)
Evidence
1use std::any::Any;
2use std::fmt::{self, Display};
3use std::str::{FromStr, from_utf8};
4use std::ops::{Deref, DerefMut};
5use base64::{encode, decode};
6use header::{Header, Raw};
7
8/// `Authorization` header, defined in [RFC7235](https://tools.ietf.org/html/rfc7235#section-4.2)
9///
10/// The `Authorization` header field allows a user agent to authenticate
11/// itself with an origin server -- usually, but not necessarily, after
12/// receiving a 401 (Unauthorized) resp …
24:12… er fpKL54jvWmEGVoRdCNjG`
25///
26/// # Examples
27///
28/// ```
29/// use hyper::header::{Headers, Authorization};
30///
31/// let mut headers = Headers::new();
32/// headers.set(Authorization("let me in".to_owned() …
78:13… r_name() -> &'static str {
79 static NAME: &'static str = "Authorization";
80 NAME
81 }
⋯4 lines
250:3… assert_eq!(
251 headers.to_string(),
252 "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\r\n".to_owned());
253 }
254
⋯4 lines
280:42…
281 headers.set(Authorization(
282 Bearer { token: "fpKL54jvWmEGVoRdCNjG".to_owned() }));
283 assert_eq!(
284 headers.to_string(),
285 "Authorization: Bearer fpKL54jvWmEGVoRdCNjG\r\ …