From 50d9adec93a6af06c78415e082535a83604d4cc9 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 8 Nov 2013 13:28:32 +1100 Subject: [PATCH] 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 --- blog/blog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blog.go b/blog/blog.go index 7c6b00a3f5..148bbefcdf 100644 --- a/blog/blog.go +++ b/blog/blog.go @@ -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 }