selenium-google-code-issue-archive
selenium-google-code-issue-archive copied to clipboard
redirects for remote web driver http commands force GET
Originally reported on Google Code with ID 8052
I have a custom remote command server for receiving instructions from java RemoteWebDriver
(FirefoxDriver, in this case). In this case, the remote server sends back a redirect
for the WebDriver command. On following the redirect, WebDriver does not check for
the METHOD of the original request, but instead just sends GET.
the bug is here:
org.openqa.selenium.remote.HttpCommandExecutor.followRedirects:
372: HttpGet get = new HttpGet(uri);
HttpGet is assumed to be the method, but that is, in my case, an incorrect assumption.
Reported by [email protected] on 2014-10-17 00:23:26
What type of redirect is your server returning?
For 302, the HTTP/1.1 spec does not require the original method be used on the redirect
request (and by convention, GET is used for redirect).
For 303, the redirected request should use GET.
HttpCommandExecutor follows convention and treats 302 as a 303, using a GET for the
2nd request.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Reported by jmleyba on 2014-10-17 17:12:28
- Status changed:
NeedsClarification
Returns a 302.
Read your linked spec again:
"Note: RFC 1945 and RFC 2068 specify that the client is not allowed
to change the method on the redirected request."
Reported by [email protected] on 2014-10-17 18:28:58
Reported by luke.semerau on 2015-09-17 17:47:30
- Labels added: Restrict-AddIssueComment-Commit