Skip to content

Commit aec744a

Browse files
committed
Match both: text/javascript as well as application/javascript
1 parent dfb2de8 commit aec744a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

browser/src/test/java/org/netbeans/html/presenters/browser/ServerMimeTypeTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void checkMimeTypes(String name, Supplier<HttpServer<?,?,?,?>> serverProv
6565
assertMimeType(cssType, "text/css");
6666

6767
String jsType = new URL(connect, "test.js").openConnection().getContentType();
68-
assertMimeType(jsType, "application/javascript");
68+
assertMimeType(jsType, "*/javascript");
6969

7070
URLConnection conn = new URL(connect, "non-existing.file").openConnection();
7171
assertTrue(conn instanceof HttpURLConnection, "it is HTTP connection: " + conn);
@@ -90,6 +90,10 @@ private void assertMimeType(String type, String exp) {
9090
if (semicolon >= 0) {
9191
type = type.substring(0, semicolon);
9292
}
93-
assertEquals(type, exp);
93+
if (exp.startsWith("*")) {
94+
assertTrue(type.endsWith(exp.substring(1)), "Expecting " + exp + " but was: " + type);
95+
} else {
96+
assertEquals(type, exp);
97+
}
9498
}
9599
}

0 commit comments

Comments
 (0)