-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Failure to encode utf-8 strings into headers
Steps to Reproduce
let password = "brocolis🥦";
let req = Request::get("https://exemple.com")
.header("Content-Type", "application/json")
.header("pswd", password);Throws the following error in http/headers.rs at line 62 : Cannot convert argument 2 to ByteString because the character at index 8 has value 55358 which is greater than 255.
Probably that there should be some error handling in those functions :
pub fn set(&self, name: &str, value: &str) {
self.raw.set(name, value).unwrap_throw()
}Here is some code to easily reproduce the error : reproduct.zip
Expected Behavior
String are just an array of u8, so I would expect the header to be sent with the ASCII representation of the utf-8 string (?)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working