Add constants
This commit is contained in:
6
main.go
6
main.go
@@ -14,7 +14,7 @@ func main() {
|
||||
defer cancel() // cancel when we are finished consuming integers
|
||||
go mdnsserver.Run(ctx)
|
||||
|
||||
http.HandleFunc("/", handle)
|
||||
http.HandleFunc("/ipp/print", handle)
|
||||
|
||||
log.Info("http server started on :1234")
|
||||
err := http.ListenAndServe(":1234", nil)
|
||||
@@ -25,6 +25,10 @@ func main() {
|
||||
|
||||
func handle(w http.ResponseWriter, r *http.Request) {
|
||||
log.Infoln("handle")
|
||||
if r.Method != "POST" {
|
||||
http.Error(w, "Unsupported method", http.StatusMethodNotAllowed)
|
||||
|
||||
}
|
||||
// Disable caching of this page
|
||||
|
||||
// Check if user is logged in, if not redirect to login page
|
||||
|
||||
Reference in New Issue
Block a user