Skip to content

Commit f980940

Browse files
Add Context to FileModifierContext
1 parent 182efa1 commit f980940

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/jrschumacher/go-spaserve"
1111
)
1212

13-
//go:embed ui/dist/*
13+
//go:embed ui/*
1414
var embeddedFiles embed.FS
1515

1616
// Define constants for application configuration

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)