text/plain output for headers
This commit is contained in:
parent
79d0d7d638
commit
a470b9e45d
1 changed files with 3 additions and 3 deletions
|
@ -13,12 +13,12 @@ end
|
||||||
|
|
||||||
map '/headers' do
|
map '/headers' do
|
||||||
headers = proc do |env|
|
headers = proc do |env|
|
||||||
[200, { "Content-Type" => "text/html" }, [
|
[200, { "Content-Type" => "text/plain" }, [
|
||||||
env.select {|key,val| key.start_with? 'HTTP_'}
|
env.select {|key,val| key.start_with? 'HTTP_'}
|
||||||
.collect {|key, val| [key.sub(/^HTTP_/, ''), val]}
|
.collect {|key, val| [key.sub(/^HTTP_/, ''), val]}
|
||||||
.collect {|key, val| CGI::escapeHTML "#{key}: #{val}"}
|
.collect {|key, val| "#{key}: #{val}"}
|
||||||
.sort
|
.sort
|
||||||
.join("<br/>\n")
|
.join("\n")
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
run headers
|
run headers
|
||||||
|
|
Loading…
Add table
Reference in a new issue