summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roseh.moe.go22
1 files changed, 3 insertions, 19 deletions
diff --git a/roseh.moe.go b/roseh.moe.go
index 4f0b86d..fd48b3c 100644
--- a/roseh.moe.go
+++ b/roseh.moe.go
@@ -1163,19 +1163,6 @@ func (h *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.h.ServeHTTP(w, r.WithContext(ctx))
}
-type loggingHandler struct {
- h http.Handler
-}
-
-func (h *loggingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- u := *r.URL
- if strings.HasPrefix(u.Path, "/otp/") {
- u.Path = "/otp/__REDACTED__"
- }
- log.Printf("%q from %q", r.Method+" "+r.Host+u.String(), r.RemoteAddr)
- h.h.ServeHTTP(w, r)
-}
-
func main() {
flag.Parse()
@@ -1254,13 +1241,12 @@ func main() {
apiMux.HandleFunc("PUT /api/wormhole/{name}", wormholeAPIUpload)
mux.Handle("/api/", apiMux)
mux.Handle("/", &timeoutHandler{h: http.HandlerFunc(notFound), timeout: 5 * time.Minute})
- serverMux := http.NewServeMux()
- serverMux.Handle(selfURL.Hostname()+"/", http.NewCrossOriginProtection().Handler(&gzipHandler{mux}))
+ http.Handle(selfURL.Hostname()+"/", http.NewCrossOriginProtection().Handler(&gzipHandler{mux}))
jellyfinURL, err := url.Parse("http://127.0.0.1:8096")
if err != nil {
log.Fatal(err)
}
- serverMux.Handle("cinema."+selfURL.Hostname()+"/", &authHandler{h: &httputil.ReverseProxy{
+ http.Handle("cinema."+selfURL.Hostname()+"/", &authHandler{h: &httputil.ReverseProxy{
Rewrite: func(r *httputil.ProxyRequest) {
r.SetURL(jellyfinURL)
r.SetXForwarded()
@@ -1282,10 +1268,8 @@ func main() {
}
cgitCGI.PathLocationHandler = cgitCGI
codeMux.Handle("/", &timeoutHandler{h: cgitCGI, timeout: 5 * time.Minute})
- serverMux.Handle("code."+selfURL.Hostname()+"/", &gzipHandler{codeMux})
+ http.Handle("code."+selfURL.Hostname()+"/", &gzipHandler{codeMux})
server := &http.Server{
- Handler: &loggingHandler{serverMux},
-
ReadHeaderTimeout: 5 * time.Minute,
IdleTimeout: 10 * time.Minute,
}