1
0
mirror of https://github.com/golang/go synced 2024-11-21 14:44:40 -07:00

godoc: canonicalize codewalk paths

R=rsc
CC=golang-dev
https://golang.org/cl/1729046
This commit is contained in:
Andrew Gerrand 2010-06-30 17:56:51 +10:00
parent 71675c6fa0
commit 4f340f5051
2 changed files with 6 additions and 1 deletions

View 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}

View 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)
}