| Summary: | Safari adds .txt extension when downloading files | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | fivoya9380 <fivoya9380> | ||||
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | NEW --- | ||||||
| Severity: | Normal | CC: | ap, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari 16 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
fivoya9380
2023-09-05 09:57:10 PDT
Steps to reproduce: Option-click on the link above. I think that this is correct behavior. GitHub doesn't provide Content-Disposition, so we don't have a download name at all - we just have the URL, which could be quite misleading - e.g. this very Bugzilla page has an URL that looks as if it were a "show_bug.cgi" file, but it's actually HTML is one were to download it. So given that the only thing we actually know about the downloaded file is that it's text/plain, adding .txt to make sure that it opens in a text editor is best. $ curl -I https://raw.githubusercontent.com/AnubisNekhet/AnuPpuccin/main/snippets/extended-colorschemes.css HTTP/2 200 cache-control: max-age=300 content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox content-type: text/plain; charset=utf-8 etag: "612064a4fab9584daceda780b8378560f1467a64520bcf4500b6b8fde3b7aa72" strict-transport-security: max-age=31536000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block x-github-request-id: 7328:6A88:F78C0:1241D4:64F77388 accept-ranges: bytes date: Tue, 05 Sep 2023 18:29:29 GMT via: 1.1 varnish x-served-by: cache-sjc1000141-SJC x-cache: MISS x-cache-hits: 0 x-timer: S1693938569.088852,VS0,VE161 vary: Authorization,Accept-Encoding,Origin access-control-allow-origin: * cross-origin-resource-policy: cross-origin x-fastly-request-id: aeba5e6b25f2d750f137cfdcd0792a30cbe91810 expires: Tue, 05 Sep 2023 18:34:29 GMT source-age: 0 content-length: 29296 I would rather have Safari support different file extensions for download like css, js, etc and allow downloading them as such, instead of adding .txt extension. If a file with extension other than the above gets downloaded with content-type: text/plain, in such cases Safari can add .txt. |