Skip to content

Commit 941874a

Browse files
authored
Fix Ngrok Tunnel Proxy (#6)
Write a 200 with a body of `OK` instead of 204 with no body
1 parent bbcafc4 commit 941874a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

handler.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (s *SubHandler) checkIfDuplicate(w http.ResponseWriter, r *http.Request, h
158158
if s.OnDuplicateNotification != nil {
159159
go s.OnDuplicateNotification(h)
160160
}
161-
writeEmpty(w) // ignore and return 2XX code
161+
writeEmptyOK(w) // ignore and return 2XX code
162162
return true, nil
163163
}
164164
}
@@ -529,11 +529,11 @@ func (s *SubHandler) handleNotification(w http.ResponseWriter, bodyBytes []byte,
529529
return
530530
}
531531

532-
writeEmpty(w)
532+
writeEmptyOK(w)
533533
}
534534

535-
// Writes a 204 No Content with Content-Length: 0 response
536-
func writeEmpty(w http.ResponseWriter) {
537-
w.Header().Set("Content-Length", "0")
538-
w.WriteHeader(http.StatusNoContent)
535+
// Writes a 200 OK response
536+
func writeEmptyOK(w http.ResponseWriter) {
537+
w.WriteHeader(http.StatusOK)
538+
_, _ = w.Write([]byte("OK"))
539539
}

0 commit comments

Comments
 (0)