Expanded make.mime with values from DOMFuzz

This commit is contained in:
pyoor 2017-04-24 11:02:50 -04:00
parent ffc107a176
commit 96d746c033

View file

@ -3,28 +3,70 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
make.mime = { make.mime = {
type: function () { types: function () {
return random.pick([
make.mime.standard,
make.mime.xml,
make.mime.image,
make.mime.media,
make.mime.form
]);
},
standard: function () {
return random.pick([ return random.pick([
"text/html", "text/html",
"text/html; charset=utf-8",
"text/plain", "text/plain",
"text/css", "text/css",
"text/javascript", "text/javascript",
"image/jpeg", "foo/bar",
"image/gif",
"image/png",
"application/rss+xml",
"application/vnd.mozilla.xul+xml",
"application/xhtml+xml",
"application/octet-stream", "application/octet-stream",
"application/x-shockwave-flash", "application/x-shockwave-flash",
"application/x-test", "application/x-test",
]);
},
xml: function () {
return random.pick([
"application/xml",
"text/xml",
"application/xhtml+xml",
"image/svg+xml",
"application/vnd.mozilla.xul+xml",
"application/rss+xml",
"application/rdf+xml",
"application/xslt+xml",
]);
},
image: function () {
return random.pick([
"image/jpeg",
"image/gif",
"image/png",
"image/mng",
"image/*",
]);
},
media: function () {
return random.pick([
"audio/mpeg", "audio/mpeg",
"audio/ogg", "audio/ogg",
"audio/ogg; codecs=vorbis", "audio/ogg; codecs=vorbis",
"video/ogg", "video/ogg",
'video/ogg; codecs="theora,vorbis"', "video/ogg; codecs=\"theora, vorbis\"",
"video/mp4", "video/mp4",
'video/mp4; codecs="avc1.42E01E,mp4a.40.2"' "video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"",
]); ]);
} },
form: function () {
return random.pick([
"application/x-www-form-urlencoded",
"multipart/form-data",
"text/plain"
]);
},
}; };