Ruby on Rails: HTTP Request Safety Methods Added

Rails adds new request.safe_method? and request.unsafe_method? predicates to ActionPack, providing standardized vocabulary for checking if HTTP requests might modify server state.

Duration: PT1M40S

Episode overview

This episode is a short developer briefing from Ruby on Rails.

It explains recent repository work in plain language.

  • Show: Ruby on Rails
  • Published: 2026-04-06T00:00:00Z
  • Audio duration: PT1M40S

Transcript excerpt

This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.

Good morning, this is your Ruby on Rails briefing for April 6th, 2026.

Today's update focuses on a single enhancement to ActionPack's HTTP request handling. Joseph Hale contributed new safety predicates for HTTP requests, which Jean Boussier has merged into the framework.

The addition introduces two new methods to ActionDispatch: request.safe_method? and request.unsafe_method?. These predicates provide a standardized way to determine whether an HTTP request might modify server state, following RFC 9110 Section 9.2.1 specifications.

Previously, developers had to write ad-hoc checks like "get? or head?" scattered throughout controllers and middleware when branching on request safety. This new implementation gives that common pattern a standard vocabulary that aligns with HTTP specifications.

The changes are contained within ActionPack's request handling layer. The implementation adds eleven lines of code to the core request class, with comprehensive test coverage including eighteen new test cases. The changelog documents this as a developer experience improvement for request state checking.

This enhancement addresses a frequent need in Rails applications where controllers and…

Nearby episodes from Ruby on Rails

  1. Weekly Recap - Security & Developer Experience Improvements
  2. Active Storage Security Warning Enhancement
  3. Documentation Fixes and API Testing Improvements
  4. Security Updates and Testing Improvements
  5. Weekly Recap - Composite Keys and Performance Optimization
  6. Composite Key Validation Fix
  7. Spring Cleaning and Clarity
  8. ActiveSupport Gets Smarter - Notifications and Cache Improvements