From 4aa650cf8070e1055c33523e6f572f2ae982029f Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Wed, 18 Jun 2014 15:44:09 +1000 Subject: [PATCH] go.tools/cmd/godoc: register redirect handler for /dl/ LGTM=minux R=golang-codereviews, gobot, bradfitz, minux CC=golang-codereviews https://golang.org/cl/107050044 --- cmd/godoc/dl.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cmd/godoc/dl.go diff --git a/cmd/godoc/dl.go b/cmd/godoc/dl.go new file mode 100644 index 00000000..bd738316 --- /dev/null +++ b/cmd/godoc/dl.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "net/http" + +// Register a redirect handler for /dl/ to the golang.org download page. +// This file will not be included when deploying godoc to golang.org. + +func init() { + http.Handle("/dl/", http.RedirectHandler("http://golang.org/dl/", http.StatusFound)) +}