diff --git a/spec/driver_spec.rb b/spec/driver_spec.rb index f17c3796..c722d085 100644 --- a/spec/driver_spec.rb +++ b/spec/driver_spec.rb @@ -223,9 +223,9 @@ subject.current_url.should == "http://127.0.0.1:#{port}/hello/world?success=true" end - it "escapes URLs" do - subject.visit("/hello there") - subject.current_url.should =~ /hello%20there/ + it "does not double-encode URLs" do + subject.visit("/hello/world?success=%25true") + subject.current_url.should =~ /success=\%25true/ end it "visits a page with an anchor" do diff --git a/src/Visit.cpp b/src/Visit.cpp index a50e3f41..2e819f3b 100644 --- a/src/Visit.cpp +++ b/src/Visit.cpp @@ -7,7 +7,7 @@ Visit::Visit(WebPage *page, QObject *parent) : Command(page, parent) { } void Visit::start(QStringList &arguments) { - QUrl requestedUrl = QUrl(arguments[0]); + QUrl requestedUrl = QUrl::fromEncoded(arguments[0].toUtf8(), QUrl::StrictMode); page()->currentFrame()->load(QUrl(requestedUrl)); }