ie8 fixes

This commit is contained in:
Tony Tam
2014-02-27 19:55:56 -08:00
parent 2a642f5a5f
commit 7b77ffd079
5 changed files with 222 additions and 194 deletions

View File

@@ -1,5 +1,5 @@
// swagger.js
// version 2.0.21
// version 2.0.22
var __bind = function(fn, me){
return function(){
@@ -15,6 +15,15 @@ log = function(){
}
};
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;
}
}
var SwaggerApi = function(url, options) {
this.url = null;
this.debug = false;
@@ -949,7 +958,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
}
}
responseContentType = null;
var responseContentType = null;
if (this.opts.responseContentType) {
responseContentType = this.opts.responseContentType;
} else {
@@ -1116,7 +1125,7 @@ JQueryHttpClient.prototype.execute = function(obj) {
headers: headers
};
var contentType = (response._headers["content-type"]||response._headers["Content-Type"]||null)
var contentType = (headers["content-type"]||headers["Content-Type"]||null)
if(contentType != null) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {