PDA

View Full Version : iPhone and Authorization header



dfa
4 Apr 2011, 2:17 AM
Sencha Touch version tested:

1.1.0

Platform tested against:

iOS 3.x

Description:

The browser allows to set the 'Authorization' header an a XMLHTTPRequest, but not sends it in the header.

Test Case:


headers:{
Authorization:'Basic abcdefg'
}

The result that was expected:

'Authorization' in the header

The result that occurs instead:

No 'Authorization' in the header

Screenshot or Video:

none

Debugging already done:

none

Possible fix:


--- a/src/public/senchatouch/sencha-touch-debug.js
+++ b/src/public/senchatouch/sencha-touch-debug.js
@@ -17368,6 +17368,8 @@ Ext.data.Connection = Ext.extend(Ext.util.Observable, {
var params = o.params,
url = o.url || me.url,
urlParams = o.urlParams,
+ username = o.username || '',
+ password = o.password || '',
extraParams = me.extraParams,
request, data, headers,
method, key, xhr;
@@ -17421,7 +17423,7 @@ Ext.data.Connection = Ext.extend(Ext.util.Observable, {
xhr = this.getXhrInstance();


- xhr.open(method.toUpperCase(), url, true);
+ xhr.open(method.toUpperCase(), url, true, username, password);


headers = Ext.apply({}, o.headers || {}, me.defaultHeaders || {});