diff --git a/cmd/qrbill-api/api.go b/cmd/qrbill-api/api.go index e475202..8092987 100644 --- a/cmd/qrbill-api/api.go +++ b/cmd/qrbill-api/api.go @@ -134,7 +134,11 @@ func logic() error { debugHTML(w, r, prefix, qrch) } - // TODO: add cache control headers + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + // […] this alone is the only directive you need in preventing cached + // responses on modern browsers. + w.Header().Add("Cache-Control", "no-store") + if _, err := io.Copy(w, bytes.NewReader(b)); err != nil { log.Printf("%s %s", prefix, err) return @@ -146,13 +150,7 @@ func logic() error { http.Error(w, "not found", http.StatusNotFound) return } - w.Header().Add("Content-Type", "text/html; charset=utf-8") - // TODO: add explanation for how to construct a URL - // e.g. for usage in filemaker web view - fmt.Fprintf(w, "