]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: canonicalize codewalk paths
authorAndrew Gerrand <adg@golang.org>
Wed, 30 Jun 2010 07:56:51 +0000 (17:56 +1000)
committerAndrew Gerrand <adg@golang.org>
Wed, 30 Jun 2010 07:56:51 +0000 (17:56 +1000)
R=rsc
CC=golang-dev
https://golang.org/cl/1729046

lib/godoc/codewalk.html
src/cmd/godoc/codewalk.go

index 1ce6393ec6fa1e894a178208b10a1dbae45705d0..47f8a22e2b73a7b01cfc813da2be4eabf94cef56 100644 (file)
@@ -15,7 +15,7 @@
     <div id="code-area">
       <div id="code-header" align="center">
         <a id="code-popout-link" href="" target="_blank">
-          <img title="View code in new window" alt="Pop Out Code" src="popout.png" style="display: block; float: right;"/>
+          <img title="View code in new window" alt="Pop Out Code" src="/doc/codewalk/popout.png" style="display: block; float: right;"/>
         </a>
         <select id="code-selector">
           {.repeated section File}
index 412214b8f538603bee284f97cac89a7f35d6f178..806849c00b1f5e5b10e53debe63f0ca08f6459c7 100644 (file)
@@ -63,6 +63,11 @@ func codewalk(c *http.Conn, r *http.Request) {
                return
        }
 
+       // Canonicalize the path and redirect if changed
+       if redirect(c, r) {
+               return
+       }
+
        b := applyTemplate(codewalkHTML, "codewalk", cw)
        servePage(c, "Codewalk: "+cw.Title, "", "", b)
 }