From 47fbc9de11d1685c0dd2ed876ea6a2fa72b1abc1 Mon Sep 17 00:00:00 2001
From: uvok cheetah
Date: Sat, 9 Dec 2023 17:41:38 +0000
Subject: rest: Check method verb in fetching registrations

---
 http/rest/registrationHandler.go | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'http/rest')

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)
-- 
cgit v1.2.3