From 161de53d86a38d556b04661815ce1c68d6b514b8 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 8 Nov 2013 13:58:44 +1100 Subject: [PATCH] [release-branch.go1.2] go.tools/blog: strip prefix when serving static content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ««« 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 --- blog/blog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blog.go b/blog/blog.go index 7c6b00a3..148bbefc 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 }