forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch FTP code to using UnescapeBinaryURLComponent().
It was using UnescapeURLComponent() to unescape some characters, while leaving others escaped, which doesn't really make sense in an FTP context. Instead, we now unescape all characters, and fail requests in the case of unsafe characters, instead of leaving just those characters escaped. Also, we no longer apply unescaping logic on the paths returned to us from the server in response to the PWD command, as that seemed unexpected. This CL is part of a project to cleaning up uses of UnescapeURLComponent(), as it's been used for wildly disparate purposes, and much of its logic is only suitable for cases where we want to format a URL for safe display to the user. We want to make it leave more weird characters escaped, but need to eliminate usage of it in other contexts before we can do that. UnescapeBinaryURLComponent() unconditionally unescapes all escaped characters, and should be used instead in most cases, particulars where URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS is in use. The primary cases where it shouldn't be used (without additional checks), are cases where unescaping path separators or funky characters (like %01) is a problem. In those places, we should generally fail, instead of partially unescaping a URL. Bug: 959280 Change-Id: Ief2dccd3f0a7e3cfb753586c51837f3596857fa9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594150 Commit-Queue: Matt Menke <mmenke@chromium.org> Reviewed-by: Eric Roman <eroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#656597}
- Loading branch information
Matt Menke
authored and
Commit Bot
committed
May 3, 2019
1 parent
9731d02
commit c7984c0
Showing
3 changed files
with
84 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters