Skip to content

Commit 574dbcf

Browse files
committed
handle head request
1 parent bdc9c68 commit 574dbcf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/api/handlers/update.go

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

129129
func HandleUpdateEvents(updater *update.Manager) http.HandlerFunc {
130130
return func(w http.ResponseWriter, r *http.Request) {
131+
// Handle HEAD requests with erly return
132+
if r.Method == http.MethodHead {
133+
render.EncodeResponse(w, http.StatusOK, nil)
134+
return
135+
}
136+
131137
slog.Info("Client connected to SSE stream", slog.String("client", r.RemoteAddr), slog.String("path", r.URL.Path), slog.String("method", r.Method))
132138
sseStream, err := render.NewSSEStream(context.WithValue(r.Context(), "remote_addr", r.RemoteAddr), w)
133139
if err != nil {

0 commit comments

Comments
 (0)