all repos — honk @ 2c0310a318c981a3bd698c2f1f915419e655872f

my fork of honk

last-modified caching interferes with debug
Ted Unangst tedu@tedunangst.com
Thu, 11 Apr 2019 10:05:37 -0400
commit

2c0310a318c981a3bd698c2f1f915419e655872f

parent

37ea6d36a1e0ba60838bd0f06c525ecded2bf3eb

2 files changed, 4 insertions(+), 2 deletions(-)

jump to
M honk.gohonk.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.htmlviews/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>