1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:54:44 -07:00

go.tools/blog: strip prefix when serving static content

This fix permits godoc to serve images correctly under /blog/.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/22700043
This commit is contained in:
Andrew Gerrand 2013-11-08 13:28:32 +11:00
parent e59751ce56
commit 50d9adec93

View File

@ -118,7 +118,7 @@ func NewServer(cfg Config) (*Server, error) {
}
// Set up content file server.
s.content = http.FileServer(http.Dir(cfg.ContentPath))
s.content = http.StripPrefix(s.cfg.BasePath, http.FileServer(http.Dir(cfg.ContentPath)))
return s, nil
}