Merge branch 'ios/testflight-account' of ssh://192.168.1.111:2222/JohnCosta27/Haystack into ios/testflight-account

This commit is contained in:
Rio Keefe
2025-05-10 22:19:28 +01:00
2 changed files with 10 additions and 0 deletions

View File

@ -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{

View File

@ -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)