@@ -86,14 +86,14 @@ func LoggerHandler(level log.Level) func(next http.Handler) http.Handler {
8686 return http .HandlerFunc (func (w http.ResponseWriter , req * http.Request ) {
8787 start := time .Now ()
8888
89- _ = log .GetLogger ("router" ).Log (0 , level , "Started %s %s for %s" , log .ColoredMethod (req .Method ), req .RequestURI , req .RemoteAddr )
89+ _ = log .GetLogger ("router" ).Log (0 , level , "Started %s %s for %s" , log .ColoredMethod (req .Method ), req .URL . RequestURI () , req .RemoteAddr )
9090
9191 next .ServeHTTP (w , req )
9292
9393 ww := middleware .NewWrapResponseWriter (w , req .ProtoMajor )
9494
9595 status := ww .Status ()
96- _ = log .GetLogger ("router" ).Log (0 , level , "Completed %s %s %v %s in %v" , log .ColoredMethod (req .Method ), req .RequestURI , log .ColoredStatus (status ), log .ColoredStatus (status , http .StatusText (status )), log .ColoredTime (time .Since (start )))
96+ _ = log .GetLogger ("router" ).Log (0 , level , "Completed %s %s %v %s in %v" , log .ColoredMethod (req .Method ), req .URL . RequestURI () , log .ColoredStatus (status ), log .ColoredStatus (status , http .StatusText (status )), log .ColoredTime (time .Since (start )))
9797 })
9898 }
9999}
@@ -107,12 +107,12 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
107107 return
108108 }
109109
110- if ! strings .HasPrefix (req .RequestURI , "/" + prefix ) {
110+ if ! strings .HasPrefix (req .URL . RequestURI () , "/" + prefix ) {
111111 next .ServeHTTP (w , req )
112112 return
113113 }
114114
115- rPath := strings .TrimPrefix (req .RequestURI , "/" + prefix )
115+ rPath := strings .TrimPrefix (req .URL . RequestURI () , "/" + prefix )
116116 u , err := objStore .URL (rPath , path .Base (rPath ))
117117 if err != nil {
118118 if os .IsNotExist (err ) || errors .Is (err , os .ErrNotExist ) {
@@ -139,12 +139,12 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
139139 return
140140 }
141141
142- if ! strings .HasPrefix (req .RequestURI , "/" + prefix ) {
142+ if ! strings .HasPrefix (req .URL . RequestURI () , "/" + prefix ) {
143143 next .ServeHTTP (w , req )
144144 return
145145 }
146146
147- rPath := strings .TrimPrefix (req .RequestURI , "/" + prefix )
147+ rPath := strings .TrimPrefix (req .URL . RequestURI () , "/" + prefix )
148148 rPath = strings .TrimPrefix (rPath , "/" )
149149
150150 fi , err := objStore .Stat (rPath )
0 commit comments