mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
return nil for redirect bodies
This commit is contained in:
parent
eea4a74d1c
commit
d66715fd8d
1 changed files with 2 additions and 0 deletions
|
|
@ -177,6 +177,7 @@ get '/posts/:year/:month/:id' do |year, month, id|
|
||||||
elsif request.accept?('text/html')
|
elsif request.accept?('text/html')
|
||||||
status 302
|
status 302
|
||||||
headers 'Location'=> "#{$config[:preview_url]}/posts/#{year}/#{month}/#{id}"
|
headers 'Location'=> "#{$config[:preview_url]}/posts/#{year}/#{month}/#{id}"
|
||||||
|
nil
|
||||||
else
|
else
|
||||||
status 400
|
status 400
|
||||||
"content not available in an acceptable format: #{request.accept.join(', ')}"
|
"content not available in an acceptable format: #{request.accept.join(', ')}"
|
||||||
|
|
@ -204,6 +205,7 @@ get '/drafts/:id' do |id|
|
||||||
elsif request.accept?('text/html')
|
elsif request.accept?('text/html')
|
||||||
status 302
|
status 302
|
||||||
headers 'Location' => "#{$config[:preview_url]}/posts/drafts/#{id}"
|
headers 'Location' => "#{$config[:preview_url]}/posts/drafts/#{id}"
|
||||||
|
nil
|
||||||
else
|
else
|
||||||
status 400
|
status 400
|
||||||
"content not available in an acceptable format: #{request.accept.join(', ')}"
|
"content not available in an acceptable format: #{request.accept.join(', ')}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue