Skip to content

Commit

Permalink
Handle absolute paths without adding wd_context_prefix
Browse files Browse the repository at this point in the history
Help resolve Issue teodesian#312.
When a redirect happens, it passes a absolute URL path back into the request method. It is an error to add the extra wd_context_prefix that the `else` block does.

This makes the code work much better with Sauce Labs when your account is busy.
  • Loading branch information
lukec authored and gempesaw committed May 25, 2017
1 parent f1370c2 commit aa9cd46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Selenium/Remote/RemoteConnection.pm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ sub request {
if ($url =~ m/^http/g) {
$fullurl = $url;
}
elsif ($url =~ m/^\//) {
# This is used when we get a 302 Redirect with a Location header.
$fullurl =
"http://"
. $self->remote_server_addr . ":"
. $self->port
. $url;
}
elsif ($url =~ m/grid/g) {
$fullurl =
"http://"
Expand Down

0 comments on commit aa9cd46

Please sign in to comment.