提交 5bf36ecf 编写于 作者: M mindless

[FIXED HUDSON-6072] Ajax.Request accepts both object(hash) or Array for requestHeaders,

but crumb.wrap only worked with hash.. now support Array as well.
This fixes ajax update of Build History when CSRF protection is turned on.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29597 71c3de6d-444a-0410-be80-ed276b4c234a
上级 9e223613
......@@ -51,12 +51,16 @@ var crumb = {
},
/**
* Adds the crumb value into the given hash and returns the hash.
* Adds the crumb value into the given hash or array and returns it.
*/
wrap: function(hash) {
if(this.fieldName!=null)
hash[this.fieldName]=this.value;
return hash;
wrap: function(headers) {
if (this.fieldName!=null) {
if (headers instanceof Array)
headers.push(this.fieldName, this.value);
else
headers[this.fieldName]=this.value;
}
return headers;
},
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册