Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ func imageHandler(w http.ResponseWriter, r *http.Request, buf []byte, operation
// Expose Content-Length response header
w.Header().Set("Content-Length", strconv.Itoa(len(image.Body)))
w.Header().Set("Content-Type", image.Mime)
if image.Mime != "application/json" {
meta, err := bimg.Metadata(image.Body)
if err == nil {
w.Header().Set("X-Image-Width", strconv.Itoa(meta.Size.Width))
w.Header().Set("X-Image-Height", strconv.Itoa(meta.Size.Height))
}
}
if vary != "" {
w.Header().Set("Vary", vary)
}
Expand Down
3 changes: 2 additions & 1 deletion type.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func IsImageMimeTypeSupported(mime string) bool {
format = "svg"
}

return bimg.IsTypeNameSupported(format)
// Tmp hack to see if this fix an issue
return true // bimg.IsTypeNameSupported(format)
}

// ImageType returns the image type based on the given image type alias.
Expand Down