Last active
August 29, 2015 14:17
-
-
Save karlcow/041156b2e4ab7e487a8d to your computer and use it in GitHub Desktop.
This will fail with Gecko not being followed by a year, but a version number like in… Firefox OS and Firefox Android. Found in http://static0.viadeo-static.com/resource/308570/tetra-viadeo-VNS.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setRequestHeaders: function() { | |
var a = { | |
'X-Requested-With': 'XMLHttpRequest', | |
'X-Prototype-Version': Prototype.Version, | |
Accept: 'text/javascript, text/html, application/xml, text/xml, */*' | |
}; | |
if ('post' == | |
this.method && ('undefined' === typeof a['Content-Type'] && (a['Content-Type'] = | |
this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : '') | |
), | |
this.transport.overrideMimeType && 2005 > (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0, 2005])[1]) | |
) a.Connection = 'close'; | |
if ('object' == typeof this.options.requestHeaders) { | |
var b = this.options.requestHeaders; | |
if (Object.isFunction(b.push)) | |
for (var c = 0, e = b.length; c < e; c += 2) a[b[c]] = b[c + 1]; | |
else $H(b).each(function(b) { | |
a[b.key] = b.value | |
}) | |
} | |
for (var f in a) this.transport.setRequestHeader(f, a[f]) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment