FileURLToFilePath should fail for non file URL's |
||
Issue descriptionThe documentation for FileURLToFilePath says, "Returns true on success, false if it isn't a valid file URL". However, this function succeeds and will return what looks like a file resource path for any valid URL. This function should verify the scheme IAW it's public contract.
,
Oct 9
This bug is not correct and it turns out that net::FileURLToFilePath can legitimately accept non file scheme URLs and return a valid file path. Will correct the function documentation and add a test to reflect this correct behavior.
,
Oct 10
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e8d8f3369c1b4aac92b39744de478834625ac10b commit e8d8f3369c1b4aac92b39744de478834625ac10b Author: Chris Mumford <cmumford@google.com> Date: Wed Oct 10 02:23:31 2018 Improve docs/test for net::FileURLToFilePath. Document that net::FileURLToFilePath can accept non file scheme URLs and improve unit test to verify this. Previously the documentation stated that FileURLToFilePath would return "false if it isn't a valid file URL" which is slightly ambiguous and may lead developers to conclude that it would return false if GURL::SchemeIsFile() returned false - which it did not. Bug: 893327 Change-Id: I6bb4656a81ad08490875ee3481c971552783cfad Reviewed-on: https://chromium-review.googlesource.com/c/1269799 Reviewed-by: David Benjamin <davidben@chromium.org> Commit-Queue: Chris Mumford <cmumford@chromium.org> Cr-Commit-Position: refs/heads/master@{#598182} [modify] https://crrev.com/e8d8f3369c1b4aac92b39744de478834625ac10b/net/base/filename_util.cc [modify] https://crrev.com/e8d8f3369c1b4aac92b39744de478834625ac10b/net/base/filename_util.h [modify] https://crrev.com/e8d8f3369c1b4aac92b39744de478834625ac10b/net/base/filename_util_unittest.cc
,
Oct 22
Working as intended but improved docs/test. |
||
►
Sign in to add a comment |
||
Comment 1 by cmumford@chromium.org
, Oct 8