mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
webrick/httputils: note Kernel#open behavior
I don't know who uses the load_mime_types method; but it is conceivable that a user would want to read the results of a command instead of reading a regular file to load MIME types. None of the WEBrick-related code in Ruby or default/bundled gems seems to rely on this method; but it is likely 3rd-party code does. * lib/webrick/httputils.rb (load_mime_types): note Kernel#open behavior [Misc #14216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1ad355bd53
commit
f2aa7f409a
1 changed files with 2 additions and 0 deletions
|
@ -108,6 +108,8 @@ module WEBrick
|
|||
# Loads Apache-compatible mime.types in +file+.
|
||||
|
||||
def load_mime_types(file)
|
||||
# note: +file+ may be a "| command" for now; some people may
|
||||
# rely on this, but currently we do not use this method by default.
|
||||
open(file){ |io|
|
||||
hash = Hash.new
|
||||
io.each{ |line|
|
||||
|
|
Loading…
Reference in a new issue