aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2022-01-08 09:18:24 -0500
committerEmmanuel Odeke <emmanuel@orijtech.com>2022-01-10 04:23:42 +0000
commit6df0957060b1315db4fd6a359eefc3ee92fcc198 (patch)
tree82386b21670ecd53161040951b0f381782f7937e /src/runtime
parent2639f2f79bda2c3a4e9ef7381ca7de14935e2a4a (diff)
downloadgo-6df0957060b1315db4fd6a359eefc3ee92fcc198.tar.xz
net/http: map FS Open errors just like Dir
When an http.FileServer is given a path like file1/file2 where file1 exists but file2 does not, the proper HTTP status should be NotFound. Some OSes return a "not a directory" error instead, so this must be mapped to NotFound. That mapping was already being done for the Dir FileSystem implementation, as discussed in #18984. But it wasn't for the FS implementation. This CL does the same mapping for FS, by generalizing the function that did it for Dir. Fixes #49552 Change-Id: I61d6aa8ef101158e9674707d44e653f5dedbd040 Reviewed-on: https://go-review.googlesource.com/c/go/+/376874 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions