Ticket #26 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Responder Mixin swallows custom status in respond_to format block

Reported by: v..@exdolo.com Assigned to: v..@exdolo.com
Priority: major Milestone:
Component: Views Keywords:
Cc:

Description

In a respond_to block, the block passed to the individual format *can not* set the status of the response, as the responder_mixin swallows any status.

e.g.:

respond_to do |format|

format.xml do

headersLocation? = '/foo/1.xml' render :nothing => 201

end

end

would yield a response code of 200, as the responder_mixin was manually setting this status when it felt it had successfully called the block. this patch modifies this behavior to inherit the status from the global request object and only set the status in case of an unsupported content-type (406 not supported). Passing spec in diff.

Attachments

merb_responder_render_nothing.diff (2.5 kB) - added by v..@exdolo.com on 03/20/07 18:09:54.

Change History

03/20/07 18:09:54 changed by v..@exdolo.com

  • attachment merb_responder_render_nothing.diff added.

03/20/07 18:13:16 changed by e.@brainspl.at

  • status changed from new to closed.
  • resolution set to fixed.

(In [202]) added vox's patch to fix responder. closes #26