preview: accept context parameter
This commit is contained in:
parent
01ff8f69aa
commit
15c02efe96
@ -161,7 +161,7 @@ func (this *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
this.handleInformation(w, r.URL.Path[len(metadataUrlPrefix):])
|
||||
|
||||
} else if r.Method == "GET" && strings.HasPrefix(r.URL.Path, previewUrlPrefix) {
|
||||
this.handlePreview(w, r.URL.Path[len(previewUrlPrefix):])
|
||||
this.handlePreview(r.Context(), w, r.URL.Path[len(previewUrlPrefix):])
|
||||
|
||||
} else if r.Method == "GET" && rxThumbUrl.MatchString(r.URL.Path) {
|
||||
parts := rxThumbUrl.FindStringSubmatch(r.URL.Path)
|
||||
|
@ -1,6 +1,7 @@
|
||||
package contented
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html"
|
||||
@ -12,7 +13,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func (this *Server) handlePreview(w http.ResponseWriter, fileIDList string) {
|
||||
func (this *Server) handlePreview(ctx context.Context, w http.ResponseWriter, fileIDList string) {
|
||||
|
||||
fileIDs := strings.Split(fileIDList, `-`)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user