diff --git a/main.go b/main.go index a7840d3..6259c66 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,6 @@ package main import ( - "bytes" "context" "errors" "flag" @@ -104,7 +103,7 @@ func NewApp(ctx context.Context, config *domain.Config) (*App, error) { return } - f, err := staticer.Do(r.Context(), r.URL.Path) + res, err := staticer.Do(r.Context(), r.URL.Path) if err != nil { if errors.Is(err, fs.ErrNotExist) { http.Error(w, err.Error(), http.StatusNotFound) @@ -117,7 +116,7 @@ func NewApp(ctx context.Context, config *domain.Config) (*App, error) { return } - http.ServeContent(w, r, f.LogicalName(), f.Updated, bytes.NewReader(f.Content)) + http.ServeContent(w, r, res.Name(), domain.ResourceModTime(res), res) return }