1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:44:49 -07:00

godoc: use dl.google.com instead of redirector.gvt1.com

Fixes golang/go#22648

Change-Id: I59185cc1ed61235a0fcfadc060c4735372586358
Reviewed-on: https://go-review.googlesource.com/76971
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Andrew Bonventre 2017-11-10 12:05:31 -05:00
parent bce7a99f8a
commit 9c477bae19

View File

@ -35,9 +35,9 @@ import (
)
const (
edgeCacheBaseURL = "https://redirector.gvt1.com/edgedl/go/"
cacheKey = "download_list_3" // increment if listTemplateData changes
cacheDuration = time.Hour
downloadBaseURL = "https://dl.google.com/go/"
cacheKey = "download_list_3" // increment if listTemplateData changes
cacheDuration = time.Hour
)
func RegisterHandlers(mux *http.ServeMux) {
@ -133,7 +133,7 @@ func (f File) Highlight() bool {
}
func (f File) URL() string {
return edgeCacheBaseURL + f.Filename
return downloadBaseURL + f.Filename
}
type Release struct {
@ -424,7 +424,7 @@ func getHandler(w http.ResponseWriter, r *http.Request) {
http.NotFound(w, r)
return
}
http.Redirect(w, r, edgeCacheBaseURL+name, http.StatusFound)
http.Redirect(w, r, downloadBaseURL+name, http.StatusFound)
}
func validUser(user string) bool {