]> Cypherpunks repositories - gostls13.git/commitdiff
Fix redirection if the page is in a subdirectory.
authorRob Pike <r@golang.org>
Mon, 1 Feb 2010 06:17:25 +0000 (17:17 +1100)
committerRob Pike <r@golang.org>
Mon, 1 Feb 2010 06:17:25 +0000 (17:17 +1100)
Fixes buggy links in the devel subdirectory.
Code from rsc; tested by me.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/197041

src/cmd/godoc/godoc.go

index 812d23824ed7a050ecf58332e46b81111ae2bb54..0ec85991e53a80e5a289e6d007fd858a6b1d85be 100644 (file)
@@ -995,6 +995,9 @@ func serveFile(c *http.Conn, r *http.Request) {
        }
 
        if dir != nil && dir.IsDirectory() {
+               if redirect(c, r) {
+                       return
+               }
                if index := path + "/index.html"; isTextFile(index) {
                        serveHTMLDoc(c, r, index)
                        return