Skip to content

Commit 899f8e9

Browse files
authored
fix: handler HEAD calls in sse routes (#96)
* fix: handler HEAD calls in sse routes * fix typo * make hotfix instead * revert other sse endpoints
1 parent cd29de0 commit 899f8e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/api/handlers/update.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ func HandleUpdateApply(updater *update.Manager) http.HandlerFunc {
127127

128128
func HandleUpdateEvents(updater *update.Manager) http.HandlerFunc {
129129
return func(w http.ResponseWriter, r *http.Request) {
130+
// HOTFIX: app-lab use HEAD requests to check endpoint availability
131+
// so we need to handle them here by early return without opening SSE stream
132+
if r.Method == http.MethodHead {
133+
render.EncodeResponse(w, http.StatusOK, nil)
134+
return
135+
}
136+
130137
sseStream, err := render.NewSSEStream(r.Context(), w)
131138
if err != nil {
132139
slog.Error("Unable to create SSE stream", slog.String("error", err.Error()))

0 commit comments

Comments
 (0)