Merge branch 'ios/testflight-account' of ssh://192.168.1.111:2222/JohnCosta27/Haystack into ios/testflight-account
This commit is contained in:
@ -216,6 +216,12 @@ func (chat *Chat) AddImage(imageName string, image []byte, query *string) error
|
||||
index += 1
|
||||
}
|
||||
|
||||
if len(extension) == 0 {
|
||||
// Hacky! It seems apple doesnt add extension.
|
||||
// BIG TODO: take better metadata from the image.
|
||||
extension = "png"
|
||||
}
|
||||
|
||||
messageContent.Content[index] = ImageMessageContent{
|
||||
ImageType: "image_url",
|
||||
ImageUrl: ImageMessageUrl{
|
||||
|
@ -91,6 +91,10 @@ func main() {
|
||||
|
||||
// TODO: this could be part of the db table
|
||||
extension := filepath.Ext(image.ImageName)
|
||||
if len(extension) == 0 {
|
||||
// Same hack
|
||||
extension = "png"
|
||||
}
|
||||
extension = extension[1:]
|
||||
|
||||
w.Header().Add("Content-Type", "image/"+extension)
|
||||
|
Reference in New Issue
Block a user