This is an automated email from the ASF dual-hosted git repository.
jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new f61d9e5 THRIFT-4737: fixed
f61d9e5 is described below
commit f61d9e52827ec14f35dde0f5c0740837a5572c83
Author: Christian Bürckert <[email protected]>
AuthorDate: Mon Jan 14 14:36:22 2019 +0100
THRIFT-4737: fixed
THRIFT-4737: [added beforeSend to add customHeaders to jqXHR in jqRequest]
Client: [lib/js]
locally tested - custom headers where missing when using jq. So I added
these lines to fix it.
---
lib/js/src/thrift.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/js/src/thrift.js b/lib/js/src/thrift.js
index 9bf8127..fad24d6 100644
--- a/lib/js/src/thrift.js
+++ b/lib/js/src/thrift.js
@@ -438,7 +438,12 @@ Thrift.TXHRTransport.prototype = {
}
},
context: client,
- success: jQuery.makeArray(args).pop()
+ success: jQuery.makeArray(args).pop(),
+ beforeSend: function (xreq) {
+ Object.keys(thriftTransport.customHeaders).forEach(function
(prop) {
+ xreq.setRequestHeader(prop,
thriftTransport.customHeaders[prop]);
+ });
+ }
});
return jqXHR;