Skip to content

Commit 888e649

Browse files
committed
fix: remove negroni middlewares
1 parent e1205eb commit 888e649

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

handler/init.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
"github.com/RoyXiang/plexproxy/common"
1313
"github.com/go-redis/redis/v8"
14-
"github.com/urfave/negroni"
1514
"github.com/victorspringer/http-cache"
1615
)
1716

@@ -52,6 +51,5 @@ func init() {
5251
}
5352

5453
func Handler(w http.ResponseWriter, r *http.Request) {
55-
lrw := negroni.NewResponseWriter(w)
56-
proxy.ServeHTTP(lrw, r)
54+
proxy.ServeHTTP(w, r)
5755
}

main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/RoyXiang/plexproxy/handler"
1212
"github.com/gorilla/mux"
13-
"github.com/urfave/negroni"
1413
)
1514

1615
func newRouter() http.Handler {
@@ -32,10 +31,7 @@ func newRouter() http.Handler {
3231
getRouter.PathPrefix("/").HandlerFunc(handler.Handler)
3332

3433
r.PathPrefix("/").HandlerFunc(handler.Handler)
35-
36-
n := negroni.Classic()
37-
n.UseHandler(r)
38-
return n
34+
return r
3935
}
4036

4137
func main() {

0 commit comments

Comments
 (0)