From 27b1e70ac1a48b329559b73a47c7067f7e6b03a5 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Thu, 22 Oct 2020 00:34:12 +0000 Subject: [PATCH] twitterchiver/viewer: fix media serving --- go/twitterchiver/viewer/viewer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/twitterchiver/viewer/viewer.go b/go/twitterchiver/viewer/viewer.go index 8be3a35e23..23df2100c9 100644 --- a/go/twitterchiver/viewer/viewer.go +++ b/go/twitterchiver/viewer/viewer.go @@ -140,7 +140,7 @@ func main() { fmt.Fprintf(rw, "

%s

", wrap) } - authR.Handle("/media/{path}", http.StripPrefix("/media/", http.FileServer(http.Dir(*mediaDirectory)))) + authR.PathPrefix("/media/").Handler(http.StripPrefix("/media/", http.FileServer(http.Dir(*mediaDirectory)))) authR.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() user := userFromContext(ctx)