Last Update: 2022-05-13 10:22:16 -0700

New Features

  • RodaRequest#http_version has been added for determining the HTTP version the request was submitted with. This will be a string such as “HTTP/1.0”, “HTTP/1.1”, “HTTP/2”, etc. This will use the SERVER_PROTOCOL and HTTP_VERSION entries from the environment to determine which HTTP version is in use.

  • The status_handler method in the status_handler plugin now supports a :keep_headers option. The value for this option should be an array of header names to keep. All other headers are removed. The default behavior without the option is still to remove all headers.

  • A run_require_slash plugin has been added, which will skip dispatching to another rack application if the remaining path is not empty and does not start with a slash.

Other Improvements

  • The status_303 plugin will use 303 as the default redirect status for non-GET requests for HTTP/2 and higher HTTP versions. Previously, it only used 303 for HTTP/1.1.

  • The not_allowed plugin now overrides the r.root method to return 405 responses to non-GET requests to the root.

  • The not_allowed plugin no longer sets the body when returning 405 responses using methods such as r.get and r.post. Previously, the body was unintentionally set to the same value as the Allow header.

  • When using the Rack master branch (what will become Rack 3), Roda only requires the parts of rack that it uses, instead of requiring rack and relying on autoload to load the parts of rack in use.