[release-branch.go1.2] go.tools/blog: strip prefix when serving static content

««« CL 22700043 / 8cdf69ad05e9
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
»»»

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/23400043
This commit is contained in:
Andrew Gerrand 2013-11-08 13:58:44 +11:00
parent 72b8aac9ec
commit 161de53d86
1 changed files with 1 additions and 1 deletions

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
}