Commit 8b11e0b4 authored by Anmol Sethi's avatar Anmol Sethi Committed by Brad Fitzpatrick

net/http: remove check for null bytes in Dir.Open()

The syscall package checks for null bytes now.
This was added in https://codereview.appspot.com/6458050

Change-Id: I59a2fed3757a25b85e2668905ff5cf2ec8c3a0d3
Reviewed-on: https://go-review.googlesource.com/34978Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 6d636064
......@@ -34,8 +34,7 @@ import (
type Dir string
func (d Dir) Open(name string) (File, error) {
if filepath.Separator != '/' && strings.ContainsRune(name, filepath.Separator) ||
strings.Contains(name, "\x00") {
if filepath.Separator != '/' && strings.ContainsRune(name, filepath.Separator) {
return nil, errors.New("http: invalid character in file path")
}
dir := string(d)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment