From 47ac50c5ae11b313e1714e42adae90bf9b29c887 Mon Sep 17 00:00:00 2001 From: GuptaNavdeep1983 Date: Mon, 23 Aug 2021 13:22:34 -0400 Subject: [PATCH] Fixed service status string. --- ondemand.go | 4 ++-- ondemand_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ondemand.go b/ondemand.go index 5474f0c..9592b2a 100644 --- a/ondemand.go +++ b/ondemand.go @@ -83,11 +83,11 @@ func (e *Ondemand) ServeHTTP(rw http.ResponseWriter, req *http.Request) { rw.Write([]byte(err.Error())) } - if status == "started" { + if status == "STARTED" { // Service started forward request e.next.ServeHTTP(rw, req) - } else if status == "starting" { + } else if status == "STARTING" { // Service starting, notify client rw.WriteHeader(http.StatusAccepted) rw.Write([]byte("Service is starting...")) diff --git a/ondemand_test.go b/ondemand_test.go index 978bddf..88883fb 100644 --- a/ondemand_test.go +++ b/ondemand_test.go @@ -72,12 +72,12 @@ func TestOndemand_ServeHTTP(t *testing.T) { }{ { desc: "service is starting", - status: "starting", + status: "STARTING", expected: 202, }, { desc: "service is started", - status: "started", + status: "STARTED", expected: 200, }, {