We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
auth::Basic
&[u8]::trim_ascii_start
1 parent de0b1a1 commit 666d991Copy full SHA for 666d991
1 file changed
src/common/authorization.rs
@@ -155,10 +155,8 @@ impl Credentials for Basic {
155
"HeaderValue to decode should start with \"Basic ..\", received = {:?}",
156
value,
157
);
158
-
159
let bytes = value.as_bytes().get("Basic ".len()..)?;
160
- let non_space_pos = bytes.iter().position(|b| *b != b' ')?;
161
- let bytes = &bytes[non_space_pos..];
+ let bytes = bytes.trim_ascii_start();
162
163
let bytes = ENGINE.decode(bytes).ok()?;
164
0 commit comments