Skip to content

Commit 0f45029

Browse files
committed
Fix webhook callback path handling
1 parent 3855e19 commit 0f45029

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

internal/server/pathspec.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ func ParseSpec(pathSpec string, apps []types.AppPathDomain) ([]types.AppPathDoma
6262
app = split[0]
6363
}
6464

65-
if app == "" {
66-
return nil, fmt.Errorf("app path spec cannot be empty")
67-
}
68-
6965
if app == "*" {
7066
app = "/*"
7167
}

internal/server/pathspec_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ func TestParsePathSpecErrors(t *testing.T) {
116116
spec string
117117
wantError error
118118
}{
119-
"Match *:": {
120-
spec: "*:",
121-
wantError: fmt.Errorf("app path spec cannot be empty"),
122-
},
123-
"Match :": {
124-
spec: ":",
125-
wantError: fmt.Errorf("app path spec cannot be empty"),
126-
},
127119
"Match a:b:c": {
128120
spec: "a:b:c",
129121
wantError: fmt.Errorf("path spec has to be in the format of domain:path"),

internal/server/router.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ func (h *Handler) webhookHandler(w http.ResponseWriter, r *http.Request, webhook
341341
resp, err = h.server.PromoteApps(r.Context(), appPath, false)
342342
}
343343

344+
h.Info().Msgf("Webhook call for %s, appPath: %s, promote: %t, reload: %t, response %+v err %s",
345+
webhookType, appPath, promote, reload, resp, err)
346+
344347
if err != nil {
345348
if reqError, ok := err.(types.RequestError); ok {
346349
w.Header().Add("Content-Type", "application/json")

0 commit comments

Comments
 (0)