socketry / falcon

A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
https://socketry.github.io/falcon/
MIT License
2.62k stars 79 forks source link

`falcon proxy` prints an exception if no `paths` are given #241

Closed postmodern closed 4 months ago

postmodern commented 4 months ago

Noticed that falcon proxy does not print an error message if no paths are given, but instead tries to call .collect on nil.

$ falcon proxy --bind http://localhost:8080
/home/postmodern/.gem/ruby/gems/io-event-1.5.1/lib/io/event/support.rb:27: warning: IO::Buffer is experimental and both the Ruby and C interface may change in the future!
  0.0s    error: Falcon::Command [ec=0x780] [pid=10441] [2024-05-09 18:26:29 -0700]
               |   NoMethodError: undefined method `collect' for nil:NilClass
               |   → .gem/ruby/gems/falcon-0.47.4/lib/falcon/command/paths.rb:15 in `resolved_paths'
               |     .gem/ruby/gems/falcon-0.47.4/lib/falcon/command/proxy.rb:59 in `block in call'
               |     /usr/local/share/gems/gems/console-1.23.2/lib/console/terminal/logger.rb:108 in `call'
               |     /usr/local/share/gems/gems/console-1.23.2/lib/console/filter.rb:138 in `call'
               |     /usr/local/share/gems/gems/console-1.23.2/lib/console/filter.rb:29 in `block (3 levels) in []'
               |     .gem/ruby/gems/falcon-0.47.4/lib/falcon/command/proxy.rb:53 in `call'
               |     .gem/ruby/gems/falcon-0.47.4/lib/falcon/command/top.rb:88 in `call'
               |     .gem/ruby/gems/samovar-2.3.0/lib/samovar/command.rb:21 in `call'
               |     .gem/ruby/gems/falcon-0.47.4/lib/falcon/command.rb:14 in `call'
               |     .gem/ruby/gems/falcon-0.47.4/bin/falcon:26 in `<top (required)>'
               |     bin/falcon:25 in `load'
               |     bin/falcon:25 in `<main>'