• Nathan Caza's avatar
    net/http: handle absolute paths in mapDirOpenError · a610957f
    Nathan Caza authored
    The current implementation does not account for Dir being
    initialized with an absolute path on systems that start
    paths with filepath.Separator. In this scenario, the
    original error is returned, and not checked for file
    segments.
    
    This change adds a test for this case, and corrects the
    behavior by ignoring blank path segments in the loop.
    
    Refs #18984
    
    Change-Id: I9b79fd0a73a46976c8e2feda0283ef0bb2b62ea1
    Reviewed-on: https://go-review.googlesource.com/36804Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    a610957f
fs.go 22.7 KB