unlink convoy unless logged in
Ted Unangst tedu@tedunangst.com
Thu, 20 Jun 2019 15:15:50 -0400
2 files changed,
8 insertions(+),
5 deletions(-)
M
honk.go
→
honk.go
@@ -1374,7 +1374,6 @@ getters.HandleFunc("/u/{name:[[:alnum:]]+}/outbox", outbox)
getters.HandleFunc("/u/{name:[[:alnum:]]+}/followers", emptiness) getters.HandleFunc("/u/{name:[[:alnum:]]+}/following", emptiness) getters.HandleFunc("/a", avatate) - getters.HandleFunc("/t", showconvoy) getters.HandleFunc("/d/{xid:[[:alnum:].]+}", servefile) getters.HandleFunc("/emu/{xid:[[:alnum:]_.-]+}", serveemu) getters.HandleFunc("/meme/{xid:[[:alnum:]_.-]+}", servememe)@@ -1405,6 +1404,7 @@ loggedin.HandleFunc("/h/{name:[[:alnum:]]+}", showhonker)
loggedin.HandleFunc("/h", showhonker) loggedin.HandleFunc("/c/{name:[[:alnum:]]+}", showcombo) loggedin.HandleFunc("/c", showcombos) + loggedin.HandleFunc("/t", showconvoy) loggedin.Handle("/savehonker", login.CSRFWrap("savehonker", http.HandlerFunc(savehonker))) err = http.Serve(listener, mux)
M
views/honk.html
→
views/honk.html
@@ -1,4 +1,5 @@
<article class="honk {{ .Honk.What }} {{ and (not .Honk.Public) "limited" }}" data-convoy="{{ .Honk.Convoy }}"> +{{ $bonkcsrf := .BonkCSRF }} {{ with .Honk }} <header> <img alt="avatar" src="/a?a={{ .Honker}}">@@ -17,9 +18,11 @@ </span>
{{ end }} {{ end }} <br> -<span style="margin-left: 1em;" class="clip"> -convoy: <a href="/t?c={{ .Convoy }}">{{ .Convoy }}</a> -</span> +{{ if $bonkcsrf }} +<span style="margin-left: 1em;" class="clip">convoy: <a href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span> +{{ else }} +<span style="margin-left: 1em;" class="clip">convoy: {{ .Convoy }}</span> +{{ end }} </header> <div class="noise"> <p>{{ .HTML }}@@ -44,7 +47,7 @@ {{ end }}
{{ end }} </div> {{ end }} -{{ if .BonkCSRF }} +{{ if $bonkcsrf }} <p> <details> <summary>Actions