[Nitro] Render#redirect question

Lars Olsson lasso at lassoweb.nu
Fri Jun 9 01:13:57 EDT 2006


Hi,

According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html the 
difference between a 302 and a 303 status codes is that the 303 status 
code explicitly tells the browser to use a GET request when redirecting. 
The 302 allows POST and HEAD as well. The 'patch' is as simple as 
changing the default for the status parameter to 302 instead of 303.


Kindly

/Lasso

________________________________________
Lars Olsson
lasso at lassoweb.nu
http://www.lassoweb.nu/

Jonas Pfenniger skrev:
> On 08/06/06, Jon A. Lambert <jlsysinc at alltel.net> wrote:
>> Just a question about nitro/render.rb
>>
>> def redirect(url, status = 303)
>>   url = url.to_s
>>   unless url =~ /^http/
>>     url = "#@base/#{url}" unless url =~ /^\//
>>     url = "#{@context.host_url}/#{url.gsub(/^\//, '')}"
>>   end
>>
>>   @context.status = status
>>   @context.out = "<html><a href=\"#{url}\">#{url}</a>.</html>\n"
>>   @context.response_headers['location'] = url
>>
>>   raise RenderExit
>> end
>>
>> Shouldn't that be status 302 assuming it's the same as the HTTP status
>> codes?
> 
> Yes it's the same as HTTP status codes but I don't know them by heart.
> Can you provide a patch ?
> 



More information about the Nitro-general mailing list