summaryrefslogtreecommitdiff
path: root/http/rest/registrationHandler.go
diff options
context:
space:
mode:
authoruvok cheetah2023-12-09 17:41:38 +0000
committeruvok cheetah2023-12-09 17:41:38 +0000
commit47fbc9de11d1685c0dd2ed876ea6a2fa72b1abc1 (patch)
treee966251acd7c8521c019236f6ca43b4e17390451 /http/rest/registrationHandler.go
parent3e9e0a3a1f0f786ff3773717da1ca6922732dc02 (diff)
rest: Check method verb in fetching registrations
Diffstat (limited to 'http/rest/registrationHandler.go')
-rw-r--r--http/rest/registrationHandler.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/http/rest/registrationHandler.go b/http/rest/registrationHandler.go
index b38d62c..cd386a4 100644
--- a/http/rest/registrationHandler.go
+++ b/http/rest/registrationHandler.go
@@ -26,6 +26,10 @@ func HandleRegistration(handler *RegistrationHandler) http.Handler {
func HandleGetRegistrations(handler *RegistrationHandler) http.Handler {
getRegs := func(w http.ResponseWriter, r *http.Request) {
+ if r.Method != http.MethodGet {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
regs, err := handler.Service.GetUnconfirmedRegistrations()
if err != nil {
w.WriteHeader(http.StatusInternalServerError)