aboutsummaryrefslogtreecommitdiff
path: root/internal/frontend/server.go
diff options
context:
space:
mode:
authorSean Liao <sean@liao.dev>2025-04-29 16:10:08 +0100
committerJonathan Amsterdam <jba@google.com>2025-05-08 08:04:49 -0700
commite476b3e609485f3999ebf60ee39b963e86e40e23 (patch)
tree5c45f3aefddc9cd3f1ea132dd14800d438183cc8 /internal/frontend/server.go
parent1bc9132f566501f5f66bfcb147479cf741704cf4 (diff)
downloadgo-x-pkgsite-e476b3e609485f3999ebf60ee39b963e86e40e23.tar.xz
internal/frontend: handle file paths with spaces
http.Handle generally handles the escaping for us, except for the first space which is used to split out the method. Fixes golang/go#73534 Change-Id: I588292ce5ffa6228f57c8e2c5f0ac5e73c27b853 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/668875 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'internal/frontend/server.go')
-rw-r--r--internal/frontend/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/frontend/server.go b/internal/frontend/server.go
index 95522fc0..70c8a4ef 100644
--- a/internal/frontend/server.go
+++ b/internal/frontend/server.go
@@ -307,7 +307,7 @@ func (s *Server) installDebugHandlers(handle func(string, http.Handler)) {
// InstallFS adds path under the /files handler, serving the files in fsys.
func (s *Server) InstallFS(path string, fsys fs.FS) {
- s.fileMux.Handle(path+"/", http.StripPrefix(path, http.FileServer(http.FS(fsys))))
+ s.fileMux.Handle("GET "+path+"/", http.StripPrefix(path, http.FileServer(http.FS(fsys))))
}
const (