mirror of https://github.com/aria2/aria2
2010-02-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Remove fragment from redirected URI. * src/Request.cc * test/RequestTest.ccpull/1/head
parent
6fa1dc11b2
commit
01fc3204f2
|
@ -1,3 +1,9 @@
|
|||
2010-02-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Remove fragment from redirected URI.
|
||||
* src/Request.cc
|
||||
* test/RequestTest.cc
|
||||
|
||||
2010-02-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Updated po templates.
|
||||
|
|
|
@ -141,7 +141,7 @@ bool Request::redirectUrl(const std::string& url) {
|
|||
} else {
|
||||
redirectedUrl = url;
|
||||
}
|
||||
return parseUrl(urlencode(redirectedUrl));
|
||||
return parseUrl(urlencode(removeFragment(redirectedUrl)));
|
||||
}
|
||||
|
||||
bool Request::parseUrl(const std::string& url) {
|
||||
|
|
|
@ -363,8 +363,8 @@ void RequestTest::testRedirectUrl() {
|
|||
req.getCurrentUrl());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, req.getRedirectCount());
|
||||
|
||||
// White space in path
|
||||
CPPUNIT_ASSERT(req.redirectUrl("http://example.org/white space"));
|
||||
// White space in path and fragment is appended.
|
||||
CPPUNIT_ASSERT(req.redirectUrl("http://example.org/white space#aria2"));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("http://example.org/white%20space"),
|
||||
req.getCurrentUrl());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue