From 1eaece3f54e831ae5d11509b9d42fc9ddbba84a2 Mon Sep 17 00:00:00 2001 From: mkwcat Date: Sat, 3 Feb 2024 16:23:16 -0500 Subject: [PATCH] NAS: Support uppercase actions --- nas/auth.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nas/auth.go b/nas/auth.go index 27637fe..29f11b7 100644 --- a/nas/auth.go +++ b/nas/auth.go @@ -63,7 +63,7 @@ func handleAuthRequest(moduleName string, w http.ResponseWriter, r *http.Request return } - if key == "ingamesn" { + if key == "ingamesn" || key == "devname" { // Special handling required for the UTF-16 string var utf16String []uint16 if unitcdString == "0" { @@ -99,7 +99,7 @@ func handleAuthRequest(moduleName string, w http.ResponseWriter, r *http.Request return } - switch action { + switch strings.ToLower(action) { case "acctcreate": reply = acctcreate() break @@ -113,10 +113,6 @@ func handleAuthRequest(moduleName string, w http.ResponseWriter, r *http.Request reply = svcloc(fields) break - case "SVCLOC": - reply = svcloc(fields) - break - default: logging.Error(moduleName, "Unknown action:", aurora.Cyan(action)) reply = map[string]string{ @@ -149,7 +145,7 @@ func handleAuthRequest(moduleName string, w http.ResponseWriter, r *http.Request return } - switch action { + switch strings.ToLower(action) { case "count": response = []byte(dlsCount(fields)) break