diff --git a/spec/driver_spec.rb b/spec/driver_spec.rb index c705b5e..8cdaf08 100644 --- a/spec/driver_spec.rb +++ b/spec/driver_spec.rb @@ -424,6 +424,12 @@ describe Capybara::Webkit::Driver do 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/ diff --git a/src/Visit.cpp b/src/Visit.cpp index 0fecc28..f7256b2 100644 --- a/src/Visit.cpp +++ b/src/Visit.cpp @@ -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); }