New issue
Advanced search Search tips

Issue 893327 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Oct 22
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

FileURLToFilePath should fail for non file URL's

Project Member Reported by cmumford@chromium.org, Oct 8

Issue description

The 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.
 
Status: Started (was: Untriaged)
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.
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Status: WontFix (was: Started)
Working as intended but improved docs/test.

Sign in to add a comment