Skip to content

Commit c06c2a7

Browse files
committed
Do not require a text mime type for patches
Many are sent as "application/octet-stream", and this check currently ignores those.
1 parent 2e69dbf commit c06c2a7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/models/attachment.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ class Attachment < ApplicationRecord
33
has_many :patch_files, dependent: :destroy
44

55
def patch?
6-
content_type&.include?('text') &&
7-
(file_name&.ends_with?('.patch') || file_name&.ends_with?('.diff') || patch_content?)
6+
file_name&.ends_with?('.patch') || file_name&.ends_with?('.diff') || patch_content?
87
end
98

109
def decoded_body

0 commit comments

Comments
 (0)