Age gate skip header

This commit is contained in:
Noah 2023-07-01 15:59:24 -07:00
parent 777fd85085
commit ba053900de

View File

@ -67,7 +67,7 @@ func AgeGate(next http.Handler) http.Handler {
ses := session.Get(r)
if val, _ := ses.Values["age-ok"].(bool); !val {
// They haven't been verified. Redirect them to the age-verify handler.
if r.FormValue("over18") == "" {
if r.FormValue("over18") == "" && r.Header.Get("X-Over-18") == "" {
responses.Redirect(w, r, "/age-verify?next="+path)
return
}