mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibWeb: Append the bytes of File objects in submitted form data
This is required to upload files to GitHub. Unfortunately, this is not currently testable with our test infrastructure. This path is only hit from HTTP/S uploads, whereas all of our tests are limited to file://.
This commit is contained in:
parent
c0d18e976e
commit
bc23c5b9fe
1 changed files with 1 additions and 1 deletions
|
@ -270,7 +270,7 @@ ErrorOr<SerializedFormData> serialize_to_multipart_form_data(Vector<XHR::FormDat
|
|||
TRY(builder.try_append(TRY(String::formatted("Content-Disposition: form-data; name=\"{}\"; filename=\"{}\"\r\n", escaped_name, escaped_filename))));
|
||||
// The parts of the generated multipart/form-data resource that correspond to file fields must have a `Content-Type` header specified.
|
||||
TRY(builder.try_append(TRY(String::formatted("Content-Type: {}\r\n\r\n", file->type()))));
|
||||
// FIXME: Serialize the contents of the file.
|
||||
TRY(builder.try_append(file->bytes()));
|
||||
TRY(builder.try_append("\r\n"sv));
|
||||
return {};
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue