Skip to content

Commit

Permalink
Fixed service status string.
Browse files Browse the repository at this point in the history
  • Loading branch information
GuptaNavdeep1983 committed Aug 23, 2021
1 parent 60ee7be commit 47ac50c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ondemand.go
Original file line number Diff line number Diff line change
Expand Up @@ -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..."))
Expand Down
4 changes: 2 additions & 2 deletions ondemand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
{
Expand Down

0 comments on commit 47ac50c

Please sign in to comment.