Skip to content

Commit 90e2084

Browse files
committed
Don't close cached publication
1 parent 7f71e92 commit 90e2084

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cmd/rwp/cmd/serve/api.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ func (s *Server) getManifest(w http.ResponseWriter, req *http.Request) {
110110
w.WriteHeader(500)
111111
return
112112
}
113-
defer publication.Close()
114113

115114
// Create "self" link in manifest
116115
scheme := "http://"
@@ -158,7 +157,7 @@ func (s *Server) getManifest(w http.ResponseWriter, req *http.Request) {
158157
w.Header().Set("access-control-allow-origin", "*") // TODO: provide options?
159158

160159
// Etag based on hash of the manifest bytes
161-
etag := strconv.FormatUint(xxh3.Hash(identJSON.Bytes()), 36)
160+
etag := `"` + strconv.FormatUint(xxh3.Hash(identJSON.Bytes()), 36) + `"`
162161
w.Header().Set("Etag", etag)
163162
if match := req.Header.Get("If-None-Match"); match != "" {
164163
if strings.Contains(match, etag) {
@@ -187,7 +186,6 @@ func (s *Server) getAsset(w http.ResponseWriter, r *http.Request) {
187186
w.WriteHeader(500)
188187
return
189188
}
190-
defer publication.Close()
191189

192190
// Make sure the asset exists in the publication
193191
href := path.Clean(vars["asset"])

0 commit comments

Comments
 (0)