Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(936)

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 1827893002: Fix handling of escaped slashes ("%2f") in FTP paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove accidentally included test code Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/ftp/ftp_network_transaction.cc
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index 3b31bc1d200bf47b8057cbba228650e98732c358..0b458007e90ab0211b9c9cf2825ae14f1a4e6dd5 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -487,8 +487,9 @@ std::string FtpNetworkTransaction::GetRequestPathForFtpCommand(
// with a trailing slash.
if (!is_directory && path.length() > 1 && path.back() == '/')
path.erase(path.length() - 1);
- UnescapeRule::Type unescape_rules = UnescapeRule::SPACES |
- UnescapeRule::URL_SPECIAL_CHARS;
+ UnescapeRule::Type unescape_rules =
+ UnescapeRule::SPACES |
+ UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS;
// This may unescape to non-ASCII characters, but we allow that. See the
// comment for IsValidFTPCommandString.
path = UnescapeURLComponent(path, unescape_rules);
« no previous file with comments | « content/child/ftp_directory_listing_response_delegate.cc ('k') | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698