mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-01-10 00:28:32 +00:00
Allow HEAD
This commit is contained in:
@@ -20,7 +20,7 @@ func NewJPEG(reader reader.ImageReader) *JPEG {
|
|||||||
|
|
||||||
// ServeHTTP handles requests on incoming connections.
|
// ServeHTTP handles requests on incoming connections.
|
||||||
func (j *JPEG) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
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)
|
http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func NewMJPEG(reader reader.ImageReader, delay int) *MJPEG {
|
|||||||
|
|
||||||
// ServeHTTP handles requests on incoming connections.
|
// ServeHTTP handles requests on incoming connections.
|
||||||
func (m *MJPEG) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
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)
|
http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user