From 6949210a02239dd12f8f75077c380e11c2463287 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 19 Jun 2014 05:57:11 +1000 Subject: [PATCH] [release-branch.go1.3] go.tools/cmd/godoc: register redirect handler for /dl/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ««« CL 107050044 / 85bf266ce14d 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 »»» TBR=bradfitz CC=golang-codereviews https://golang.org/cl/105290045 --- 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)) +}