From d3f6d73788c4e6f632fd1ba85b190006a986a463 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 3 Mar 2022 15:41:11 +0000 Subject: [PATCH] fix regex matching in app and function services --- app/handler/app.go | 2 +- function/handler/function.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/handler/app.go b/app/handler/app.go index 14ffe12..3b5302c 100644 --- a/app/handler/app.go +++ b/app/handler/app.go @@ -23,7 +23,7 @@ var ( OwnerKey = "app/owner/" ServiceKey = "app/service/" ReservationKey = "app/reservation/" - NameFormat = regexp.MustCompilePOSIX("[a-z0-9]+") + NameFormat = regexp.MustCompilePOSIX("^[a-z0-9]+$") ) type Reservation struct { diff --git a/function/handler/function.go b/function/handler/function.go index e2ea65c..2b87775 100644 --- a/function/handler/function.go +++ b/function/handler/function.go @@ -5,8 +5,8 @@ import ( ) var ( - IDFormat = regexp.MustCompilePOSIX("[a-z0-9-]+") - NameFormat = regexp.MustCompilePOSIX("[a-z0-9]+") + IDFormat = regexp.MustCompilePOSIX("^[a-z0-9-]+$") + NameFormat = regexp.MustCompilePOSIX("^[a-z0-9]+$") FunctionKey = "function/func/" OwnerKey = "function/owner/"