Bug 214516
Summary: | File constructor should replace all "/" chars with ":" in passed name | ||
---|---|---|---|
Product: | WebKit | Reporter: | Irakli Gozalishvili <contact> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | achristensen, aestes, ahmad.saleem792, ap, beidson, bfulgham, rniwa, rwlbuis, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 13 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Irakli Gozalishvili
According to the web File spec https://www.w3.org/TR/FileAPI/#file-constructor passed name should be normalized by replacing all `/` chars with `:` (quoting relevant fragment below)
> Let n be a new string of the same size as the fileName argument to the constructor. Copy every character from fileName to n, replacing any "/" character (U+002F SOLIDUS) with a ":" (U+003A COLON).
Safari does not seem to escape `/` characters. Running following code produces `foo/bar`
```
new File([], 'foo/bar').name // => "foo/bar"
```
While according to the spec it should produce `foo:bar`.
Firefox seems to behave according to specification:
Chrome seems to exhibit same bug https://bugs.chromium.org/p/chromium/issues/detail?id=1107071
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/65770796>
Ahmad Saleem
Spec agreed that no special treatment need to be performed:
https://github.com/w3c/FileAPI/issues/41
Commit - https://github.com/w3c/FileAPI/commit/a7f27059f04dfe81d2b58c516549fd7004cf5e29
*** Using below:
console.log(new File([], '/').name);
All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6) generate "/" in console.
Since all browsers match and spec are changed, I am going to mark this as "RESOLVED WONTFIX". Thanks!