Skip to content

Commit b37eab0

Browse files
committed
Remove dead code in redirect method
Sinatra 4 require Rack 3, so it will never be used with servers not updated for Rack 3, hence we never need to fall back to `HTTP_VERSION`.
1 parent 25fb001 commit b37eab0

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/sinatra/base.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,7 @@ def block.each; yield(call) end
308308

309309
# Halt processing and redirect to the URI provided.
310310
def redirect(uri, *args)
311-
# SERVER_PROTOCOL is required in Rack 3, fall back to HTTP_VERSION
312-
# for servers not updated for Rack 3 (like Puma 5)
313-
http_version = env['SERVER_PROTOCOL'] || env['HTTP_VERSION']
311+
http_version = env['SERVER_PROTOCOL']
314312
if (http_version == 'HTTP/1.1') && (env['REQUEST_METHOD'] != 'GET')
315313
status 303
316314
else

0 commit comments

Comments
 (0)