Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-4956

Redirection doesn't work with HSTS for POST requests in aerogear-push-ios-registration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.3.0
    • 1.2.0
    • push

      When trying to perform iOS device registration using POST against (e.g. OpenShift http://secure-pushee.rhcloud.com) that redirects to 'https' the client fails to redirect to the secure endpoint as defined in the 'Location:' header returned by the initial response. Instead it transforms the POST request to a GET, erasing the POST parameters, and then re-attemps the request against the insecure endpoint.

      This is the default 'erroneous' behaviour for POST requests against 302-redirected endpoints that most user-agents follow. See RFC 2616 (section 10.3.3) and related blog post here.

      We need to 'override' that 'default' behaviour by adding a 'setRedirectResponseBlock' on the Operation class which will return the original attempted NSURLRequest with the URL parameter updated to point to the new 'Location' header.

            cvasilak_jira Christos Vasilakis (Inactive)
            cvasilak_jira Christos Vasilakis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: