Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIME handling of multipart form data isn't working in several cases #25106

Open
pshaughn opened this issue Dec 5, 2019 · 3 comments
Open

MIME handling of multipart form data isn't working in several cases #25106

pshaughn opened this issue Dec 5, 2019 · 3 comments
Labels
A-content/dom Interacting with the DOM from web content A-network

Comments

@pshaughn
Copy link
Member

pshaughn commented Dec 5, 2019

WPT fetch/api/response/response-consume.html fails several cases by getting "Inappropriate MIME-type for Body" thrown by script/body.rs. The comment at https://github.com/servo/servo/blob/master/components/script/body.rs#L187 is probably relevant.

Other cases are failing on ReadableStream, but this seems entirely disjoint from that.

@jdm jdm added A-content/dom Interacting with the DOM from web content A-network labels Dec 5, 2019
@jdm jdm added this to To do in web-platform-test failures via automation Dec 5, 2019
@CYBAI
Copy link
Member

CYBAI commented Dec 5, 2019

In case there's any code changes to body.rs, just helped to paste its permalink below 👇

// TODO
// ... Parser for Mime(TopLevel::Multipart, SubLevel::FormData, _)
// ... is not fully determined yet.
if mime.type_() == mime::APPLICATION && mime.subtype() == mime::WWW_FORM_URLENCODED {
let entries = form_urlencoded::parse(&bytes);
let formdata = FormData::new(None, root);
for (k, e) in entries {
formdata.Append(USVString(k.into_owned()), USVString(e.into_owned()));
}
return Ok(FetchedData::FormData(formdata));
}

@pshaughn
Copy link
Member Author

pshaughn commented Dec 5, 2019

Right, any one of these issues could stay in the system a long time so I should remember to do that. Thanks.

@pshaughn
Copy link
Member Author

pshaughn commented Dec 22, 2019

We're using the url crate to parse urlencoded form data; maybe there's just another crate we can use to parse multipart form data? https://docs.rs/multipart/ might work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/dom Interacting with the DOM from web content A-network
Projects
Development

No branches or pull requests

3 participants