Method: Puma::DSL#supported_http_methods
- Defined in:
- lib/puma/dsl.rb
#supported_http_methods(methods) ⇒ Object
Note:
If the methods value is :any, no method check with be performed, similar to Puma v5 and earlier.
Supported http methods, which will replace Puma::Const::SUPPORTED_HTTP_METHODS. The value of :any will allows all methods, otherwise, the value must be an array of strings. Note that methods are all uppercase.
Puma::Const::SUPPORTED_HTTP_METHODS is conservative, if you want a complete set of methods, the methods defined by the [IANA Method Registry](www.iana.org/assignments/http-methods/http-methods.xhtml) are pre-defined as the constant Puma::Const::IANA_HTTP_METHODS.
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 |
# File 'lib/puma/dsl.rb', line 1437 def supported_http_methods(methods) if methods == :any [:supported_http_methods] = :any elsif Array === methods && methods == (ary = methods.grep(String).uniq) && !ary.empty? [:supported_http_methods] = ary else raise "supported_http_methods must be ':any' or a unique array of strings" end end |