mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
fix: File to FormData not correctly handling name and lastModified (#36458)
Set File's lastModified when reconstructing from Blob for FormData Remove special character replacement in fileName (spec removed this step) Testing: WPT tests exist Fixes: #22744 (if I undertand the issue correctly the filename issue was already fixed and now this fixes the lastModified part) Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
parent
5c7cf7aed6
commit
2d2cfade36
4 changed files with 7 additions and 21 deletions
|
@ -275,12 +275,13 @@ impl FormData {
|
|||
};
|
||||
|
||||
let bytes = blob.get_bytes().unwrap_or_default();
|
||||
let last_modified = blob.downcast::<File>().map(|file| file.get_modified());
|
||||
|
||||
File::new(
|
||||
&self.global(),
|
||||
BlobImpl::new_from_bytes(bytes, blob.type_string()),
|
||||
name,
|
||||
None,
|
||||
last_modified,
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue