From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS6939 216.218.128.0/17 X-Spam-Status: No, score=1.0 required=3.0 tests=AWL,BAYES_00,RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_ZBI,RCVD_IN_XBL,RDNS_NONE,SPF_FAIL,SPF_HELO_FAIL shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from 80x24.org (unknown [216.218.222.14]) by dcvr.yhbt.net (Postfix) with ESMTP id B23ED1F42E for ; Thu, 21 Dec 2017 11:55:34 +0000 (UTC) From: Eric Wong To: spew@80x24.org Subject: [PATCH 6/6] webrick/httputils: note Kernel#open behavior Date: Thu, 21 Dec 2017 11:55:07 +0000 Message-Id: <20171221115507.27500-7-e@80x24.org> In-Reply-To: <20171221115507.27500-1-e@80x24.org> References: <20171221115507.27500-1-e@80x24.org> List-Id: 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 --- lib/webrick/httputils.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb index 586971dd06..a4cd3b48ee 100644 --- a/lib/webrick/httputils.rb +++ b/lib/webrick/httputils.rb @@ -108,6 +108,8 @@ def normalize_path(path) # 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| -- EW