aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/gcp/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/gcp/main.go b/cmd/gcp/main.go
index e8ad6ba..19823ba 100644
--- a/cmd/gcp/main.go
+++ b/cmd/gcp/main.go
@@ -14,6 +14,12 @@ import (
)
func redirect(resp http.ResponseWriter, req *http.Request) {
+ if req.Method != "GET" {
+ resp.Header()["Allow"] = []string{"GET"}
+ resp.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+
pkg := path.Join(req.Host, req.URL.Path)
resp.Header()["Content-Type"] = []string{"text/html; charset=utf-8"}
if v, ok := req.URL.Query()["go-get"]; ok && len(v) > 0 && v[0] == "1" {