Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

visit no longer tries to fix invalid URLs #239

Closed
wants to merge 1 commit into from

2 participants

@pgieser

This change allows perfectly valid, encoded urls to be visited. (Before they would be double-encoded)

As a consequence of this change, unencoded urls (that need encoding) will not work when visited.

From the capybara list: http://groups.google.com/group/ruby-capybara/browse_thread/thread/9016972307f0427c/ffb27820a0fe4e24?lnk=gst&q=webkit#ffb27820a0fe4e24

@halogenandtoast

Merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 11, 2012
  1. @pgieser
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +3 −3 spec/driver_spec.rb
  2. +1 −1  src/Visit.cpp
View
6 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
View
2  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));
}
Something went wrong with that request. Please try again.