You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
called Result::unwrap() on an Err value: InvalidHeaderValue
thread 'test::form::tests::multipart' panicked at 'called Result::unwrap() on an Err value: InvalidHeaderValue', poem/src/test/form.rs:160:45
Steps to Reproduce the Problem
#[tokio::test]
async fn multipart() {
let mut a = Vec::new();
TestForm::new()
.field(TestFormField::text("1").filename("r"))
.field(TestFormField::text("2").name("r"))
.into_async_read()
.read_to_end(&mut a)
.await
.unwrap();
fn legal_str(s: impl AsRef<str>) -> String {
s.as_ref()
.replace('\\', "\\\\")
.replace('\"', "\\\"")
.replace('r', "\\\r") <<<<< The error occurs because of this wrong replacing. Looks like it should be .replace('\r' ...
.replace('\n', "\\\n")
}
The text was updated successfully, but these errors were encountered:
Expected Behavior
No errors
Actual Behavior
poem/src/test/form.rs:157] &content_disposition = "form-data; name="\\r""
called
Result::unwrap()
on anErr
value: InvalidHeaderValuethread 'test::form::tests::multipart' panicked at 'called
Result::unwrap()
on anErr
value: InvalidHeaderValue', poem/src/test/form.rs:160:45Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: