File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
lib/discourse_chatbot/functions Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require_relative '../function'
4- require 'mime/types'
54
65module DiscourseChatbot
76 class PaintEditFunction < Function
@@ -66,11 +65,10 @@ def process(args, opts)
6665 file_path = path = Discourse . store . path_for ( last_image_upload )
6766 base64_encoded_data = Base64 . strict_encode64 ( File . read ( file_path ) )
6867
69-
7068 file_path = Discourse . store . path_for ( last_image_upload )
7169 extension = last_image_upload . extension
72- mime_type = :: MIME :: Types . type_for ( extension ) . first . to_s
73-
70+ mime_type = MiniMime . lookup_by_extension ( extension ) . content_type
71+
7472 f = Tempfile . new ( [ "e1_image" , ".#{ extension } " ] )
7573 f . binmode
7674 f . write ( File . binread ( file_path ) )
Original file line number Diff line number Diff line change 55# authors: merefield
66# url: https://github.com/merefield/discourse-chatbot
77
8- gem 'mime-types-data' , '3.2025.0617' , { require : false }
9- gem 'mime-types' , '3.7.0' , { require : false }
108gem 'multipart-post' , '2.4.0' , { require : false }
119gem 'faraday-multipart' , '1.0.4' , { require : false }
1210gem 'event_stream_parser' , '1.0.0' , { require : false }
You can’t perform that action at this time.
0 commit comments