From ea95ad93a1882d131346281a35b5c64a2d762c7b Mon Sep 17 00:00:00 2001 From: Shahan Khan Date: Mon, 7 Oct 2019 15:12:03 -0700 Subject: [PATCH] Support for better content type detection with images on S3 --- imageproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageproxy.go b/imageproxy.go index 1b9a528..052533f 100644 --- a/imageproxy.go +++ b/imageproxy.go @@ -189,7 +189,7 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) { } contentType, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if contentType == "" { + if contentType == "" || contentType == "application/octet-stream" || contentType == "binary/octet-stream" { // try to detect content type b := bufio.NewReader(resp.Body) resp.Body = ioutil.NopCloser(b)