diff options
author | Andrew Gerrand <adg@golang.org> | 2010-06-30 17:56:51 +1000 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2010-06-30 17:56:51 +1000 |
commit | e755108e7e59857f1fad471d7552966c0f5ddc33 (patch) | |
tree | 24213875a6d63644ac255c5e531df847e63fd8a3 | |
parent | 4c57d240fbefa6e297826f4e8acef44a9d060260 (diff) | |
download | golang-e755108e7e59857f1fad471d7552966c0f5ddc33.tar.gz |
godoc: canonicalize codewalk paths
R=rsc
CC=golang-dev
http://codereview.appspot.com/1729046
-rw-r--r-- | lib/godoc/codewalk.html | 2 | ||||
-rw-r--r-- | src/cmd/godoc/codewalk.go | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/godoc/codewalk.html b/lib/godoc/codewalk.html index 1ce6393ec..47f8a22e2 100644 --- a/lib/godoc/codewalk.html +++ b/lib/godoc/codewalk.html @@ -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} diff --git a/src/cmd/godoc/codewalk.go b/src/cmd/godoc/codewalk.go index 412214b8f..806849c00 100644 --- a/src/cmd/godoc/codewalk.go +++ b/src/cmd/godoc/codewalk.go @@ -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) } |