remove gorilla
This commit is contained in:
parent
db970dcf06
commit
279f4b65f8
|
@ -339,29 +339,6 @@
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "5f1c01d9f64b941dd9582c638279d046eda6ca31"
|
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]]
|
[[projects]]
|
||||||
name = "github.com/issue9/identicon"
|
name = "github.com/issue9/identicon"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
|
|
|
@ -40,14 +40,6 @@ ignored = ["google.golang.org/appengine*"]
|
||||||
#version = "0.6.5"
|
#version = "0.6.5"
|
||||||
revision = "ad69f7d8f0861a29438154bb0a20b60501298480"
|
revision = "ad69f7d8f0861a29438154bb0a20b60501298480"
|
||||||
|
|
||||||
[[override]]
|
|
||||||
name = "github.com/gorilla/mux"
|
|
||||||
revision = "757bef944d0f21880861c2dd9c871ca543023cba"
|
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/gorilla/context"
|
|
||||||
version = "1.1.1"
|
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/lafriks/xormstore"
|
name = "github.com/lafriks/xormstore"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
11
cmd/web.go
11
cmd/web.go
|
@ -20,7 +20,6 @@ import (
|
||||||
"code.gitea.io/gitea/routers/routes"
|
"code.gitea.io/gitea/routers/routes"
|
||||||
|
|
||||||
"github.com/Unknwon/com"
|
"github.com/Unknwon/com"
|
||||||
context2 "github.com/gorilla/context"
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
ini "gopkg.in/ini.v1"
|
ini "gopkg.in/ini.v1"
|
||||||
)
|
)
|
||||||
|
@ -64,7 +63,7 @@ func runHTTPRedirector() {
|
||||||
http.Redirect(w, r, target, http.StatusTemporaryRedirect)
|
http.Redirect(w, r, target, http.StatusTemporaryRedirect)
|
||||||
})
|
})
|
||||||
|
|
||||||
var err = runHTTP(source, context2.ClearHandler(handler))
|
var err = runHTTP(source, handler)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(4, "Failed to start port redirection: %v", err)
|
log.Fatal(4, "Failed to start port redirection: %v", err)
|
||||||
|
@ -141,19 +140,19 @@ func runWeb(ctx *cli.Context) error {
|
||||||
var err error
|
var err error
|
||||||
switch setting.Protocol {
|
switch setting.Protocol {
|
||||||
case setting.HTTP:
|
case setting.HTTP:
|
||||||
err = runHTTP(listenAddr, context2.ClearHandler(m))
|
err = runHTTP(listenAddr, m)
|
||||||
case setting.HTTPS:
|
case setting.HTTPS:
|
||||||
if setting.RedirectOtherPort {
|
if setting.RedirectOtherPort {
|
||||||
go runHTTPRedirector()
|
go runHTTPRedirector()
|
||||||
}
|
}
|
||||||
err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, context2.ClearHandler(m))
|
err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, m)
|
||||||
case setting.FCGI:
|
case setting.FCGI:
|
||||||
listener, err := net.Listen("tcp", listenAddr)
|
listener, err := net.Listen("tcp", listenAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(4, "Failed to bind %s", listenAddr, err)
|
log.Fatal(4, "Failed to bind %s", listenAddr, err)
|
||||||
}
|
}
|
||||||
defer listener.Close()
|
defer listener.Close()
|
||||||
err = fcgi.Serve(listener, context2.ClearHandler(m))
|
err = fcgi.Serve(listener, m)
|
||||||
case setting.UnixSocket:
|
case setting.UnixSocket:
|
||||||
if err := os.Remove(listenAddr); err != nil && !os.IsNotExist(err) {
|
if err := os.Remove(listenAddr); err != nil && !os.IsNotExist(err) {
|
||||||
log.Fatal(4, "Failed to remove unix socket directory %s: %v", listenAddr, 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 {
|
if err = os.Chmod(listenAddr, os.FileMode(setting.UnixSocketPermission)); err != nil {
|
||||||
log.Fatal(4, "Failed to set permission of unix socket: %v", err)
|
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:
|
default:
|
||||||
log.Fatal(4, "Invalid protocol: %s", setting.Protocol)
|
log.Fatal(4, "Invalid protocol: %s", setting.Protocol)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue