website: redirect bare /dl to /download

Change-Id: Ie5f249d478fcb589824c056bf61c7af7c54155ab
This commit is contained in:
Brad Fitzpatrick 2015-12-30 10:50:54 -08:00
parent 01eb400955
commit 33ce243eb9
1 changed files with 4 additions and 0 deletions

View File

@ -889,6 +889,10 @@ func gerritRedirect(w http.ResponseWriter, r *http.Request) {
} }
func releaseRedirect(w http.ResponseWriter, r *http.Request) { func releaseRedirect(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/dl" || r.URL.Path == "/dl/" {
http.Redirect(w, r, "https://camlistore.org/download/", http.StatusFound)
return
}
dest := "https://storage.googleapis.com/camlistore-release/" dest := "https://storage.googleapis.com/camlistore-release/"
if len(r.URL.Path) > len("/dl/") { if len(r.URL.Path) > len("/dl/") {
dest += r.URL.Path[1:] dest += r.URL.Path[1:]