diff options
Diffstat (limited to 'lib/webrick/httpservlet/abstract.rb')
| -rw-r--r-- | lib/webrick/httpservlet/abstract.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/webrick/httpservlet/abstract.rb b/lib/webrick/httpservlet/abstract.rb index 5375c4622d..f8bf14a330 100644 --- a/lib/webrick/httpservlet/abstract.rb +++ b/lib/webrick/httpservlet/abstract.rb @@ -48,8 +48,7 @@ module WEBrick end def do_OPTIONS(req, res) - m = self.methods.grep(/^do_[A-Z]+$/) - m.collect!{|i| i.sub(/do_/, "") } + m = self.methods.grep(/\Ado_([A-Z]+)\z/) {$1} m.sort! res["allow"] = m.join(",") end @@ -59,7 +58,7 @@ module WEBrick def redirect_to_directory_uri(req, res) if req.path[-1] != ?/ location = WEBrick::HTTPUtils.escape_path(req.path + "/") - if req.query_string && req.query_string.size > 0 + if req.query_string && req.query_string.bytesize > 0 location << "?" << req.query_string end res.set_redirect(HTTPStatus::MovedPermanently, location) |
