should change method to GET when following 303 redirect #11214

Open
WojtekKruszewski opened this Issue Apr 8, 2013 · 8 comments

Projects

None yet

6 participants

@WojtekKruszewski

When my server responds to PUT/DELETE with 303 redirect, PhantomJS follows the redirect with original request method. It correctly changes request method to GET after POST requests. Here's a snippet from my server log:

[127.0.0.1] Started DELETE "/clients/809315521/workflow_instances/122797022" for 127.0.0.1 at 2013-04-08 05:21:27 +0200
[127.0.0.1] Redirected to http://127.0.0.1:57228/clients/809315521/workflow_instances
[127.0.0.1] Completed 303 See Other in 24ms (ActiveRecord: 5.2ms)
[127.0.0.1] Started DELETE "/clients/809315521/workflow_instances" for 127.0.0.1 at 2013-04-08 05:21:28 +0200

RFC2616 states that:
The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource.
http://tools.ietf.org/html/rfc2616#section-10.3.4

@WojtekKruszewski

XHR in Chrome, Safari, FF does change request method to GET on 303 redirects, as expected.

@schmilblick

@WojtekKruszewski Haha, I stumbled over this issue when Googling for redirect issues with PhantomJS, you are not alone! ๐Ÿ‘ :)

@jprince
jprince commented Jul 14, 2015

๐Ÿ‘

@jprince jprince added a commit to jprince/sleepers-and-keepers that referenced this issue Jul 14, 2015
@jprince jprince Get failing test to pass ariya/phantomjs#11214 712cbcb
@jprince jprince added a commit to jprince/sleepers-and-keepers that referenced this issue Jul 14, 2015
@jprince jprince Add route for DELETE method and keeper edit path
This is a workaround needed to make the test for removing keepers (in league_manager_spec)
pass. There's currently a bug in PhantomJS (ariya/phantomjs#11214)
that causes PhantomJS to make a request for 303 redirect with the original request method,
in this case DELETE instead of a GET.
f5deb44
@villesundberg

๐Ÿ‘

@asok
asok commented May 17, 2016

Yup I have the same when using poltergeist which is based on phantomjs.

@maxjustus

๐Ÿ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment