|
39 | 39 | import java.util.stream.Stream; |
40 | 40 |
|
41 | 41 | import jdk.internal.util.OperatingSystem; |
42 | | -import jdk.internal.util.OSVersion; |
43 | 42 | import jdk.internal.util.StaticProperty; |
44 | 43 |
|
45 | 44 | /** |
@@ -189,18 +188,8 @@ public static void main(String[] args) throws IOException { |
189 | 188 | exTypes.add(new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))); |
190 | 189 | exTypes.add(new ExType("wasm", List.of("application/wasm"))); |
191 | 190 |
|
192 | | - // extensions with content type that differs on Windows 11+ and |
193 | | - // Windows Server 2025 |
194 | | - if (OperatingSystem.isWindows() && |
195 | | - (StaticProperty.osName().matches("^.*[11|2025]$") || |
196 | | - new OSVersion(10, 0).compareTo(OSVersion.current()) > 0)) { |
197 | | - System.out.println("Windows 11+ detected: using different types"); |
198 | | - exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip", "application/x-compressed"))); |
199 | | - exTypes.add(new ExType("csv", List.of("text/csv", "application/vnd.ms-excel"))); |
200 | | - exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed", "application/x-compressed"))); |
201 | | - exTypes.add(new ExType("rtf", List.of("application/rtf", "text/rtf", "application/msword"))); |
202 | | - exTypes.add(new ExType("7z", List.of("application/x-7z-compressed", "application/x-compressed"))); |
203 | | - } else { |
| 191 | + // extensions with consistent content type on Unix (but not on Windows) |
| 192 | + if (!OperatingSystem.isWindows()) { |
204 | 193 | exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip"))); |
205 | 194 | exTypes.add(new ExType("csv", List.of("text/csv"))); |
206 | 195 | exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed"))); |
|
0 commit comments