File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -267,17 +267,6 @@ def renderer
267267 @renderer ||= [ ]
268268 end
269269
270- SUPPORTED_MIMES = %w[
271- text/plain
272- text/html
273- text/latex
274- application/json
275- application/javascript
276- image/png
277- image/jpeg
278- image/svg+xml
279- ]
280-
281270 def match ( &block )
282271 @match = FormatMatcher . new ( &block )
283272 priority 0
@@ -434,7 +423,9 @@ def format(mime = nil, &block)
434423 match { |obj | obj . respond_to? ( :path ) && obj . method ( :path ) . arity == 0 && File . readable? ( obj . path ) }
435424 format do |obj |
436425 mime = MIME ::Types . of ( obj . path ) . first . to_s
437- [ mime , File . read ( obj . path ) ] if SUPPORTED_MIMES . include? ( mime )
426+ if mime && DEFAULT_MIME_TYPE_FORMAT_METHODS . key? ( mime )
427+ [ mime , File . read ( obj . path ) ]
428+ end
438429 end
439430 end
440431 end
You can’t perform that action at this time.
0 commit comments