Skip to content

Commit

Permalink
text/plain output for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
akostadinov committed Sep 13, 2017
1 parent 79d0d7d commit a470b9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ end

map '/headers' do
headers = proc do |env|
[200, { "Content-Type" => "text/html" }, [
[200, { "Content-Type" => "text/plain" }, [
env.select {|key,val| key.start_with? 'HTTP_'}
.collect {|key, val| [key.sub(/^HTTP_/, ''), val]}
.collect {|key, val| CGI::escapeHTML "#{key}: #{val}"}
.collect {|key, val| "#{key}: #{val}"}
.sort
.join("<br/>\n")
.join("\n")
]]
end
run headers
Expand Down

0 comments on commit a470b9e

Please sign in to comment.