Skip to content

Instantly share code, notes, and snippets.

@karlcow
Last active August 29, 2015 14:17
Show Gist options
  • Save karlcow/041156b2e4ab7e487a8d to your computer and use it in GitHub Desktop.
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
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