Skip to content

Commit 176b408

Browse files
authored
[ruby/sinatra] Only set headers not created by servers (#9575)
+------------------------+-----+-----+-----+------+-------+---------+--------------+ | branch_name| json| db|query|update|fortune|plaintext|weighted_score| +------------------------+-----+-----+-----+------+-------+---------+--------------+ | master|62219|24663| 8786| 6706| 20755| 62218| 849| |remove-redundant-headers|76413|31652|13103| 6976| 19379| 60110| 982| +------------------------+-----+-----+-----+------+-------+---------+--------------+
1 parent e10ad45 commit 176b408

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

frameworks/Ruby/sinatra-sequel/hello_world.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def rand1
3333

3434
after do
3535
response['Date'] = Time.now.httpdate
36-
end
36+
end if defined?(Falcon) || defined?(Puma)
3737

3838
after do
3939
response['Server'] = SERVER_STRING

frameworks/Ruby/sinatra/hello_world.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def rand1
3333

3434
after do
3535
response['Date'] = Time.now.httpdate
36-
end
36+
end if defined?(Falcon) || defined?(Puma) || defined?(Agoo)
3737

3838
after do
3939
response['Server'] = SERVER_STRING

0 commit comments

Comments
 (0)