Example #1
0
// Handler for requests to "/check"
func CheckHandler(w http.ResponseWriter, r *http.Request) {
	inputFingerprint := r.FormValue("fingerprint")
	if inputFingerprint != "" {
		utils.Sanitizer(&inputFingerprint, ":", " ")

		data := newPD("Check result")
		data.addPayload("fp", inputFingerprint)

		r := repo.GetRepo()
		if ok, e := r.GetEntry(inputFingerprint); ok {
			data.addPayload("Entry", e)
		}

		t := parse("result.html")
		t.Execute(w, data)

		return
	}
	http.Redirect(w, r, _baseurl, http.StatusFound)
}