From 279f4b65f89c034807d33dd4ca4eb3fb7e8d3f00 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 11 Oct 2018 01:31:50 +0000 Subject: [PATCH] remove gorilla --- Gopkg.lock | 23 ----------------------- Gopkg.toml | 8 -------- cmd/web.go | 11 +++++------ 3 files changed, 5 insertions(+), 37 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 1fea221b7..999e6d312 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -339,29 +339,6 @@ packages = ["."] revision = "5f1c01d9f64b941dd9582c638279d046eda6ca31" -[[projects]] - name = "github.com/gorilla/context" - packages = ["."] - revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" - version = "v1.1.1" - -[[projects]] - name = "github.com/gorilla/mux" - packages = ["."] - revision = "757bef944d0f21880861c2dd9c871ca543023cba" - -[[projects]] - name = "github.com/gorilla/securecookie" - packages = ["."] - revision = "e59506cc896acb7f7bf732d4fdf5e25f7ccd8983" - version = "v1.1.1" - -[[projects]] - name = "github.com/gorilla/sessions" - packages = ["."] - revision = "ca9ada44574153444b00d3fd9c8559e4cc95f896" - version = "v1.1" - [[projects]] name = "github.com/issue9/identicon" packages = ["."] diff --git a/Gopkg.toml b/Gopkg.toml index 97f736b5f..e6b8d62e0 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -40,14 +40,6 @@ ignored = ["google.golang.org/appengine*"] #version = "0.6.5" revision = "ad69f7d8f0861a29438154bb0a20b60501298480" -[[override]] - name = "github.com/gorilla/mux" - revision = "757bef944d0f21880861c2dd9c871ca543023cba" - -[[constraint]] - name = "github.com/gorilla/context" - version = "1.1.1" - [[constraint]] name = "github.com/lafriks/xormstore" version = "1.0.0" diff --git a/cmd/web.go b/cmd/web.go index bc3cee69e..c6333bc6d 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -20,7 +20,6 @@ import ( "code.gitea.io/gitea/routers/routes" "github.com/Unknwon/com" - context2 "github.com/gorilla/context" "github.com/urfave/cli" ini "gopkg.in/ini.v1" ) @@ -64,7 +63,7 @@ func runHTTPRedirector() { http.Redirect(w, r, target, http.StatusTemporaryRedirect) }) - var err = runHTTP(source, context2.ClearHandler(handler)) + var err = runHTTP(source, handler) if err != nil { log.Fatal(4, "Failed to start port redirection: %v", err) @@ -141,19 +140,19 @@ func runWeb(ctx *cli.Context) error { var err error switch setting.Protocol { case setting.HTTP: - err = runHTTP(listenAddr, context2.ClearHandler(m)) + err = runHTTP(listenAddr, m) case setting.HTTPS: if setting.RedirectOtherPort { go runHTTPRedirector() } - err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, context2.ClearHandler(m)) + err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, m) case setting.FCGI: listener, err := net.Listen("tcp", listenAddr) if err != nil { log.Fatal(4, "Failed to bind %s", listenAddr, err) } defer listener.Close() - err = fcgi.Serve(listener, context2.ClearHandler(m)) + err = fcgi.Serve(listener, m) case setting.UnixSocket: if err := os.Remove(listenAddr); err != nil && !os.IsNotExist(err) { log.Fatal(4, "Failed to remove unix socket directory %s: %v", listenAddr, err) @@ -169,7 +168,7 @@ func runWeb(ctx *cli.Context) error { if err = os.Chmod(listenAddr, os.FileMode(setting.UnixSocketPermission)); err != nil { log.Fatal(4, "Failed to set permission of unix socket: %v", err) } - err = http.Serve(listener, context2.ClearHandler(m)) + err = http.Serve(listener, m) default: log.Fatal(4, "Invalid protocol: %s", setting.Protocol) }