Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19950

iOS: HTTP requests with basic auth returning with 401 Unauthorised trigger endless repeated requests

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 5.1.2
    • Component/s: iOS
    • Environment:
      • Ti SDK 5.0.2.GA and 5.1.0.v20151104190037 (earlier SDKs don't seem to be affected)
      • iOS 9.1 on device & simulator
      • Mac OSX 10.11.1
      • Node v0.10.38
    • Story Points:
      5

      Description

      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:

      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();
      

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              shodan_uk Terry Morgan
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20656
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code