Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Possibility to remove X-* headers for CORS request

`setRequestHeaders()` unconditionally adds specific headers to any request.

This patch gives possibility to remove these headers in order to allow simple CORS request.

Based on and
  • Loading branch information...
commit 2811f40a464b69274f407a3e39ce0e08584f39bd 1 parent fe2b76f
@victor-homyakov victor-homyakov authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/prototype/ajax/request.js
4 src/prototype/ajax/request.js
@@ -259,8 +259,10 @@ Ajax.Request = Class.create(Ajax.Base, {
$H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ // skip null or undefined values
for (var name in headers)
- this.transport.setRequestHeader(name, headers[name]);
+ if (headers[name] != null)
+ this.transport.setRequestHeader(name, headers[name]);
Please sign in to comment.
Something went wrong with that request. Please try again.