commit a8dfda2ebf2404ed93a272cff374fed76baa53db
parent 3a97fd68ae769e68f2e0c7cf4caf7e0564d069b2
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 8 May 2022 11:39:10 +1000
remove unused RMail::Header monkey-patch
This was not actually applying, because of module load order, and it
didn't actually work anyway ('value' is not defined). It's not needed
because RMail header values are always stripped, they can never consist
of only whitespace. Thus the existing 'content_type' method in RMail
works fine.
Diffstat:
1 file changed, 0 insertions(+), 25 deletions(-)
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
@@ -118,31 +118,6 @@ module RMail
# end
end
end
-
- class Header
- ## Be more cautious about invalid content-type headers
- ## the original RMail code calls
- ## value.strip.split(/\s*;\s*/)[0].downcase
- ## without checking if split returned an element
-
- # This returns the full content type of this message converted to
- # lower case.
- #
- # If there is no content type header, returns the passed block is
- # executed and its return value is returned. If no block is passed,
- # the value of the +default+ argument is returned.
- def content_type(default = nil)
- if value = self['content-type'] and ct = value.strip.split(/\s*;\s*/)[0]
- return ct.downcase
- else
- if block_given?
- yield
- else
- default
- end
- end
- end
- end
end
class Module