Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2656] Problem with redirects on POST

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:59:43.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M05
ComponentsiOS
Labelsdefect, ios, iphone, release-1.6.0, reported-1.5.1
ReporterAlan DuBoff
AssigneeMarshall Culpepper
Created2011-04-15T03:26:04.000+0000
Updated2011-04-17T01:59:43.000+0000

Description


Reported by Julien | October 26th, 2010 @ 08:52 AM | in 1.2.0

Hi,

I'm using createHTTPClient to POST to a page. I receive a 302. Titanium seems to follow through the 302 with another POST, not a GET.

Any idea why it's that way ? Is it a bug ?

Thanks.

I'm filing this ticket for Julien as it was in Desktop, and it is a Mobile issue which still exists on the 1.5.1 Mobile SDK.

Julien did test and verify it on the 1.5.1 SDK for me. I'm assigning this to Marshall, but feel free to move to anyone else.

Attachments

FileDateSize
t2656.tgz2011-04-15T03:26:05.000+0000862121

Comments

  1. Opie Cyrus 2011-04-15

    Hi Alan,

    I was unable to reproduce the problem your describing on Mobile SDK. When I submit a POST request to a test page that returns a 302 redirect the new request is sent as a GET request according to the environment variables the test page displays.

    Can you please provide further details and ideally a test app?

    Thanks

  2. Julien 2011-04-15

    Hi,

    This issue occurs for me on iPhone, I haven't tested it on Android. I've included :

    • A PHP script that will trigger the redirect
    • The Titanium application (basically just a button that send the request). You have to modify the source to point to the PHP script
    • Screenshot of what happens on Firefox (via Firebug) : a POST followed by a GET
    • Screenshot of what happens on iPhone (via Charles) : multiple POST
  3. Don Thorp 2011-04-15

    Updating tags and assign it to Ralf.

  4. Ralf Pfeiffer 2011-04-15

    This seems iPhone only, per description.

    Assigning to Steve to see if we can plan for R1.6.0.

  5. Stephen Tramer 2011-04-15

    Going to assign to M05 as part of the XHR work.

  6. Jeff Haynie 2011-04-15

    (from [6a69e427c8455c363ef362c40d396c00c0f6d889]) [#2656 state:fixed-in-qa] Actually fix the 301/302/303 redirect in ASI that the code documentation says was fixed. https://github.com/appcelerator/titanium_mobile/commit/6a69e427c8455c363ef362c40d396c00c0f6d889"> https://github.com/appcelerator/titanium_mobile/commit/6a69e427c845...

  7. Alan Leard 2011-04-15

    Notes/Comments

    Successful iOS Simulator, iOS Device, and Android Emulator test on 01/25/2011

       iOS Simulator: "POST /appcelerator/test.php HTTP/1.1" 302 99 "
                      "GET /appcelerator/test.php HTTP/1.1" 200 99 "
       
       iPhone:        "POST /appcelerator/test.php HTTP/1.1" 302 99 "
                      "GET /appcelerator/test.php HTTP/1.1" 200 99 "
       
       Emulator:      "POST /appcelerator/test.php HTTP/1.1" 302 97 "
                      "GET /appcelerator/test.php HTTP/1.1" 200 97 "
       

    Mobile SDK version: 1.6.0 (01/25/11 13:33 1f1dd51...)

    Device/Version: iPhone 4 / 4.2.1

    Simulator Version: 4.2 (235)

    Emulator SDK: APIs 2.1

JSON Source