Permalink
Browse files

Attempt to visit URLs with invalid characters

* Fixes issues with URLs which include square brackets
  • Loading branch information...
1 parent 0cffabd commit 525a8bb1306295689098d371dd4f6f826efd6cdd @Locke23rus Locke23rus committed with jferris Nov 9, 2013
Showing with 7 additions and 1 deletion.
  1. +6 −0 spec/driver_spec.rb
  2. +1 −1 src/Visit.cpp
View
@@ -424,6 +424,12 @@ def visit(url, driver=driver)
driver.current_url.should =~ /success=\%25true/
end
+ it "returns the current URL with encoded characters" do
+ visit("/hello/world?success[value]=true")
+ current_url = Rack::Utils.unescape(driver.current_url)
+ current_url.should include('success[value]=true')
+ end
+
it "visits a page with an anchor" do
visit("/hello#display_none")
driver.current_url.should =~ /hello#display_none/
View
@@ -7,7 +7,7 @@ Visit::Visit(WebPageManager *manager, QStringList &arguments, QObject *parent) :
}
void Visit::start() {
- QUrl requestedUrl = QUrl::fromEncoded(arguments()[0].toUtf8(), QUrl::StrictMode);
+ QUrl requestedUrl = QUrl::fromEncoded(arguments()[0].toUtf8(), QUrl::TolerantMode);
page()->currentFrame()->load(QUrl(requestedUrl));
finish(true);
}

0 comments on commit 525a8bb

Please sign in to comment.