mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-02 20:23:32 +08:00
feature (turboload): decrease load time via sw
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
. "github.com/mickael-kerjean/filestash/server/common"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
. "github.com/mickael-kerjean/filestash/server/common"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -58,6 +59,10 @@ func (w *ResponseWriter) Write(b []byte) (int, error) {
|
||||
return w.ResponseWriter.Write(b)
|
||||
}
|
||||
|
||||
func (w *ResponseWriter) Flush() {
|
||||
w.ResponseWriter.(http.Flusher).Flush()
|
||||
}
|
||||
|
||||
func PluginInjector(fn HandlerFunc) HandlerFunc {
|
||||
for _, middleware := range Hooks.Get.Middleware() {
|
||||
fn = middleware(fn)
|
||||
|
||||
Reference in New Issue
Block a user