Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9305 (new defect)

Opened 2 years ago

Last modified 1 year ago

[patch] Dispatcher.failsafe_response_body find strange error path

Reported by: kou Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Dispatcher.failsafe_response_body find a error_path by

error_path = "#{RAILS_ROOT}/public/#{status[0..3]}.html"

But status[0..3] extracts 4 characters even if HTTP status is 3 digits. (e.g. 404, 500 and so on)

We should extract just 3 characters.

Attachments

rails-dispatcher-status.diff (474 bytes) - added by kou on 08/20/07 00:57:38.

Change History

08/20/07 00:57:38 changed by kou

  • attachment rails-dispatcher-status.diff added.

02/18/08 01:03:44 changed by kou

  • component changed from Railties to ActionPack.

ActionController::Dispatcher still uses Array#[0..3] to extract 3 characters. It should use Array#[0, 3] or Array#[0...3] for that.