We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
bearer
Into<Cow>
1 parent 5bf947e commit 1ad9fb6Copy full SHA for 1ad9fb6
src/browser/fetch/header.rs
@@ -49,8 +49,8 @@ impl<'a> Header<'a> {
49
}
50
51
/// Create `Authorization: Bearer xxx` header.
52
- pub fn bearer(token: &str) -> Header<'a> {
53
- Self::custom("Authorization", format!("Bearer {}", token))
+ pub fn bearer(token: impl Into<Cow<'a, str>>) -> Header<'a> {
+ Self::custom("Authorization", format!("Bearer {}", token.into()))
54
55
56
/// Create custom header.
0 commit comments