last-modified caching interferes with debug
Ted Unangst tedu@tedunangst.com
Thu, 11 Apr 2019 10:05:37 -0400
2 files changed,
4 insertions(+),
2 deletions(-)
M
honk.go
→
honk.go
@@ -177,8 +177,10 @@ var modtime time.Time
if len(honks) > 0 { modtime = honks[0].Date } + debug := false + getconfig("debug", &debug) imh := r.Header.Get("If-Modified-Since") - if imh != "" && !modtime.IsZero() { + if !debug && imh != "" && !modtime.IsZero() { ifmod, err := time.Parse(http.TimeFormat, imh) if err == nil && !modtime.After(ifmod) { w.WriteHeader(http.StatusNotModified)
M
views/honkform.html
→
views/honkform.html
@@ -2,7 +2,7 @@ <p>
<button onclick="showhonkform(); return false"><a href="/newhonk">it's honking time</a></button> <form id="honkform" action="/honk" method="POST" enctype="multipart/form-data" style="display: none"> <p></p> -<input type="hidden" name="rid" value=""> +ly: <input type="text" name="rid" value=""> <input type="hidden" name="CSRF" value="{{ .HonkCSRF }}"> <textarea name="noise" id="honknoise"></textarea> <p>