omg
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func isMethodAllowed(response *http.ResponseWriter, request *http.Request) bool {
|
||||
if request.Method != http.MethodPost {
|
||||
http.Error(*response, "POST only", http.StatusMethodNotAllowed)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func RegisterHandler(response http.ResponseWriter, request *http.Request) {
|
||||
if !isMethodAllowed(&response, request) {
|
||||
return
|
||||
}
|
||||
|
||||
ctx := request.Context()
|
||||
}
|
||||
Reference in New Issue
Block a user