mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
fix(phoenix-channel): replace all non-ASCII chars in user agent (#9725)
HTTP headers only reliably support ASCII characters. We include information like the user's kernel build name in there and therefore need to strip non-ASCII characters from that to avoid encoding errors. Fixes: #9706
This commit is contained in:
@@ -825,6 +825,8 @@ fn make_request(url: Url, host: String, user_agent: String) -> Request {
|
||||
OsRng.fill_bytes(&mut r);
|
||||
let key = base64::engine::general_purpose::STANDARD.encode(r);
|
||||
|
||||
let user_agent = user_agent.replace(|c: char| !c.is_ascii(), "");
|
||||
|
||||
Request::builder()
|
||||
.method("GET")
|
||||
.header("Host", host)
|
||||
|
||||
Reference in New Issue
Block a user