1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-23 23:51:06 +01:00

Account for joining ':' in basic auth (#2)

This commit is contained in:
Till Höppner 2018-07-01 15:25:00 +02:00 committed by svartalf
parent 488b7bf653
commit 67f0aceea6

View File

@ -70,7 +70,7 @@ impl IntoHeaderValue for Basic {
fn try_into(self) -> Result<HeaderValue, <Self as IntoHeaderValue>::Error> {
let mut credentials = BytesMut::with_capacity(
self.username.len() + self.password.as_ref().map_or(0, |pwd| pwd.len())
self.username.len() + 1 + self.password.as_ref().map_or(0, |pwd| pwd.len())
);
credentials.put(&self.username);
credentials.put_u8(b':');