extras/autoindex.rb in yahns-1.12.5 vs extras/autoindex.rb in yahns-1.13.0
- old
+ new
@@ -166,11 +166,12 @@
end
if Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include?(code)
[ code, {}, [] ]
else
- h = { 'Content-Type' => 'text/plain', 'Content-Length' => '0' }
- [ code, h, [] ]
+ msg = "#{code} #{Rack::Utils::HTTP_STATUS_CODES[code.to_i]}\n"
+ h = { 'Content-Type' => 'text/plain', 'Content-Length' => msg.size.to_s }
+ [ code, h, [ msg ] ]
end
end
def human_size(st)
if st.file?