[OpenWrt-Devel] [PATCH] mimetypes: add json and jsonp (distinct from js)

Karl Palsson karlp at tweak.net.au
Thu Oct 23 10:00:29 EDT 2014


From: Karl Palsson <karlp at remake.is>

.js files are being transferred as text/javascript, which, although
obsolete by RFC 4329 is most backward compatible.

.json and .jsonp are both transferred as application/octet-stream
however, causing warnings on the console for some browsers, even though
it works just fine.

Add the mimetypes for .json as per RFC 4627 and .jsonp as per RFC4329
(As jsonp _is_ javascript)

Signed-off-by: Karl Palsson <karlp at remake.is>
---
 mimetypes.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mimetypes.h b/mimetypes.h
index 64370ce..0651486 100644
--- a/mimetypes.h
+++ b/mimetypes.h
@@ -46,6 +46,8 @@ static const struct mimetype uh_mime_types[] = {
 	{ "jpeg",    "image/jpeg" },
 	{ "svg",     "image/svg+xml" },
 
+	{ "json",    "application/json" },
+	{ "jsonp",   "application/javascript" },
 	{ "zip",     "application/zip" },
 	{ "pdf",     "application/pdf" },
 	{ "xml",     "application/xml" },
-- 
1.8.3.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list