diff --git a/handlers/jpeg.go b/handlers/jpeg.go index 69bafd3..3ed8389 100644 --- a/handlers/jpeg.go +++ b/handlers/jpeg.go @@ -20,7 +20,7 @@ func NewJPEG(reader reader.ImageReader) *JPEG { // ServeHTTP handles requests on incoming connections. func (j *JPEG) ServeHTTP(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { + if r.Method != "GET" && r.Method != "HEAD" { http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed) return } diff --git a/handlers/mjpeg.go b/handlers/mjpeg.go index 6893c1d..59073f5 100644 --- a/handlers/mjpeg.go +++ b/handlers/mjpeg.go @@ -26,7 +26,7 @@ func NewMJPEG(reader reader.ImageReader, delay int) *MJPEG { // ServeHTTP handles requests on incoming connections. func (m *MJPEG) ServeHTTP(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { + if r.Method != "GET" && r.Method != "HEAD" { http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed) return }