am 47f356d0: Merge "Prefer "jpg" over "jpeg" as the extension for "image/jpeg"."
* commit '47f356d012543f359b0a23d3838337d9c457de34':
Prefer "jpg" over "jpeg" as the extension for "image/jpeg".
diff --git a/luni/src/main/java/libcore/net/MimeUtils.java b/luni/src/main/java/libcore/net/MimeUtils.java
index a5a1469..125ea87 100644
--- a/luni/src/main/java/libcore/net/MimeUtils.java
+++ b/luni/src/main/java/libcore/net/MimeUtils.java
@@ -259,8 +259,9 @@
add("image/ico", "cur");
add("image/ico", "ico");
add("image/ief", "ief");
- add("image/jpeg", "jpeg");
+ // add ".jpg" first so it will be the default for guessExtensionFromMimeType
add("image/jpeg", "jpg");
+ add("image/jpeg", "jpeg");
add("image/jpeg", "jpe");
add("image/pcx", "pcx");
add("image/png", "png");
diff --git a/luni/src/test/java/libcore/net/MimeUtilsTest.java b/luni/src/test/java/libcore/net/MimeUtilsTest.java
index 2cc58e9..ff22632 100644
--- a/luni/src/test/java/libcore/net/MimeUtilsTest.java
+++ b/luni/src/test/java/libcore/net/MimeUtilsTest.java
@@ -48,4 +48,8 @@
assertEquals("png", MimeUtils.guessExtensionFromMimeType("image/png"));
assertEquals("zip", MimeUtils.guessExtensionFromMimeType("application/zip"));
}
+
+ public void test_18390752() {
+ assertEquals("jpg", MimeUtils.guessExtensionFromMimeType("image/jpeg"));
+ }
}