Skip to content

Commit

Permalink
Merge pull request #1210 from larskanis/add-svg-to-image-filenames
Browse files Browse the repository at this point in the history
Add "svg" as a extension of image filenames
  • Loading branch information
lsegal authored Jan 22, 2019
2 parents 47b7e82 + ea49a3c commit 97e1346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/yard/server/commands/display_file_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DisplayFileCommand < LibraryCommand
def run
filename = File.cleanpath(File.join(library.source_path, path))
raise NotFoundError unless File.file?(filename)
if filename =~ /\.(jpe?g|gif|png|bmp)$/i
if filename =~ /\.(jpe?g|gif|png|bmp|svg)$/i
headers['Content-Type'] = StaticFileCommand::DefaultMimeTypes[$1.downcase] || 'text/html'
render File.read_binary(filename)
else
Expand Down

0 comments on commit 97e1346

Please sign in to comment.