Project: titanium
Issue TIMOB-19950: iOS: HTTP requests with basic auth returning with 401 Unauthorised trigger endless repeated requests
Making an HTTP request with basic auth that that results in a 401 response causes the same request to be repeated resulting in an endless loop of HTTP requests. Neither onload nor onerror callback is called. Test case: {code} var url = "http://httpbin.org/basic-auth/user/passwd"; var client = Ti.Network.createHTTPClient({ // function called when the response data is available onload : function(e) { Ti.API.info("Received text: " + this.responseText); alert('success'); }, // function called when an error occurs, including a timeout onerror : function(e) { Ti.API.debug(e.error); alert('error'); }, username: "test", password: "test", timeout : 5000 // in milliseconds }); // Prepare the connection. client.open("GET", url); // Send the request. client.send(); {code}
Story points: 5