aboutsummaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorStormwind <stormwind@stormwinds-page.de>2023-06-01 09:11:34 +0200
committerStormwind <stormwind@stormwinds-page.de>2023-06-01 09:11:34 +0200
commite96b602cb88e78adfed009ccd620c4385af01a0b (patch)
tree366c0a8a3f22ad76b487ec438e748f5c935a84aa /spec/unit
parentb582ca5d8aafdf9bfaccbe67c74aa532cbfc4f1a (diff)
Correct HTTP status code on redirect
With the release of RFC 7231 in June 2014 the HTTP status code 302 - Moved Temporarily does no longer exist in this form and has been replaced by 302 - Found, which causes the browser to use the same request method to call the new resource. Which can cause unwanted deletions of resouces, when a child resource is deleted and the browser gets redirected to the parent resource. Instead we use now the status code 303 - See Others, which specifies, that the referred resource has to be called using the GET method.
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/zero/response/redirect_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/zero/response/redirect_spec.rb b/spec/unit/zero/response/redirect_spec.rb
index 41ec369..ea51668 100644
--- a/spec/unit/zero/response/redirect_spec.rb
+++ b/spec/unit/zero/response/redirect_spec.rb
@@ -5,11 +5,11 @@ describe Zero::Response do
subject { Zero::Response.new() }
describe '#redirect' do
- it "sets the status to 302 and the given Location URL in header" do
+ it "sets the status to 303 and the given Location URL in header" do
subject.redirect 'http://foo.bar/relocated/thingy'
value = subject.to_a
- value[0].should eq(302)
+ value[0].should eq(303)
value[1]['Location'].should eq('http://foo.bar/relocated/thingy')
end