mirror of
https://github.com/actix/actix-web.git
synced 2025-02-07 23:02:20 +00:00
Actix-web client: Always append a colon after username in basic auth (#949)
* Always append a colon after username in basic auth * Update CHANGES.md
This commit is contained in:
parent
5901dfee1a
commit
d2eb1edac3
4 changed files with 13 additions and 6 deletions
|
@ -1,5 +1,12 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.2.2] - TBD
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Always append a colon after username in basic auth
|
||||||
|
|
||||||
|
|
||||||
## [0.2.1] - 2019-06-05
|
## [0.2.1] - 2019-06-05
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -115,7 +115,7 @@ impl ClientBuilder {
|
||||||
{
|
{
|
||||||
let auth = match password {
|
let auth = match password {
|
||||||
Some(password) => format!("{}:{}", username, password),
|
Some(password) => format!("{}:{}", username, password),
|
||||||
None => format!("{}", username),
|
None => format!("{}:", username),
|
||||||
};
|
};
|
||||||
self.header(
|
self.header(
|
||||||
header::AUTHORIZATION,
|
header::AUTHORIZATION,
|
||||||
|
@ -164,7 +164,7 @@ mod tests {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
"Basic dXNlcm5hbWU="
|
"Basic dXNlcm5hbWU6"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ impl ClientRequest {
|
||||||
{
|
{
|
||||||
let auth = match password {
|
let auth = match password {
|
||||||
Some(password) => format!("{}:{}", username, password),
|
Some(password) => format!("{}:{}", username, password),
|
||||||
None => format!("{}", username),
|
None => format!("{}:", username),
|
||||||
};
|
};
|
||||||
self.header(
|
self.header(
|
||||||
header::AUTHORIZATION,
|
header::AUTHORIZATION,
|
||||||
|
@ -664,7 +664,7 @@ mod tests {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
"Basic dXNlcm5hbWU="
|
"Basic dXNlcm5hbWU6"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ impl WebsocketsRequest {
|
||||||
{
|
{
|
||||||
let auth = match password {
|
let auth = match password {
|
||||||
Some(password) => format!("{}:{}", username, password),
|
Some(password) => format!("{}:{}", username, password),
|
||||||
None => format!("{}", username),
|
None => format!("{}:", username),
|
||||||
};
|
};
|
||||||
self.header(AUTHORIZATION, format!("Basic {}", base64::encode(&auth)))
|
self.header(AUTHORIZATION, format!("Basic {}", base64::encode(&auth)))
|
||||||
}
|
}
|
||||||
|
@ -443,7 +443,7 @@ mod tests {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
"Basic dXNlcm5hbWU="
|
"Basic dXNlcm5hbWU6"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue