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

Windows: HTTPClient: Invalid Status Codes returned

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 7.4.1
    • Fix Version/s: Release 8.0.0
    • Component/s: Windows
    • Labels:
      None
    • Environment:
    • Story Points:
      5
    • Sprint:
      2018 Sprint 25

      Description

      GET request should be returning a status of "301" or "302"; instead returns a status code of "200"

      Test case

       
      var xhr = Titanium.Network.createHTTPClient();
      xhr.autoRedirect = false;
      xhr.allResponseHeaders = true;
       
      // what to do if it loads
      xhr.onload = function(e) {
       
      	Ti.API.log('Status = ' + this.getStatus());
       
      	if (this.getStatus() == 301) {
      		Ti.API.log('Redirect to ' + this.getResponseHeader('location'));
      	} else {
      		Ti.API.log('This should have returned a 301 not a 200');
      	}
      };
       
      xhr.open('GET', 'http://google.co.nz');
      xhr.send();
      

      Actual result:
      Following is returned:

      [INFO] Status = 200
      [INFO] This should have returned a 301 not a 200
      

      Expected result:
      Following should be returned:

      [INFO] :   Status = 301
      [INFO] :   Redirect to http://www.google.co.nz/
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                smohammed Samir Mohammed
                Reviewer:
                Josh Longton
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code