teach
/
akhet
Archived
1
0
Fork 0
This repository has been archived on 2020-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
akhet/vote.go

21 lines
391 B
Go

package main
import (
"log"
"net/http"
)
func Vote(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
r.ParseForm()
log.Printf("Handling new vote from %s: %s [%s]\n", r.Header.Get("X-Forwarded-For"), r.URL.Path, r.UserAgent())
for k, v := range r.PostForm {
log.Println(k + ":", v)
}
http.ServeFile(w, r, "thanks.html")
} else {
http.NotFound(w, r)
}
}