Skip to content

Commit 36ef266

Browse files
Add Context to FileModifierContext
1 parent 182efa1 commit 36ef266

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

handlers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ func (h *modifyingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
299299
headersToServe := w.Header()
300300
fileModifierContext := FileModifierContext{
301301
Request: FileModifierContextRequest{
302+
Context: ctx,
302303
Headers: headersToServe.Clone(),
303304
Path: fsPath,
304305
},

interfaces.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package spaserve
22

33
import (
4-
"context" // Keep context for logger just in case
4+
"context"
55
"log/slog"
66
"net/http"
77
)
@@ -11,6 +11,7 @@ type FileModifier interface {
1111
}
1212

1313
type FileModifierContextRequest struct {
14+
Context context.Context
1415
Headers http.Header
1516
Path string
1617
}

0 commit comments

Comments
 (0)