From 9f308ff5dc272da6e739a783f65d14eb55b99857 Mon Sep 17 00:00:00 2001 From: Mient-jan Stelling Date: Tue, 28 Jan 2014 13:07:29 +0100 Subject: [PATCH] Added raw type to possible requested files. By adding the type raw @line 314 and 232 in the setType method. reqwest is now compatible with nonstandard file type's like binary mp3, midi etc. --- reqwest.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reqwest.js b/reqwest.js index fc7beeb..aa3cf46 100644 --- a/reqwest.js +++ b/reqwest.js @@ -230,8 +230,8 @@ } function setType(url) { - var m = url.match(/\.(json|jsonp|html|xml)(\?|$)/) - return m ? m[1] : 'js' + var m = url.match(/\.(json|jsonp|html|xml|js)(\?|$)/) + return m ? m[1] : 'raw' } function init(o, fn) { @@ -312,6 +312,7 @@ resp = eval(r) break case 'html': + case 'raw': resp = r break case 'xml':