Sha256: 93028c0b87b0330accf971886006803b4199c68f65faa6b0ff7cdc92ebc5ffc3
Contents?: true
Size: 570 Bytes
Versions: 4
Compression:
Stored size: 570 Bytes
Contents
require 'm2r/response' module M2R class Response # Adds Content-Length header based on body size # This is mostly required when you use bare # Response class without any framework on top of it. # HTTP clients require such header when there is # body in response. Otherwise they hang out. # # @api public module ContentLength def headers(value = GETTER) if value == GETTER h = super h['Content-Length'] ||= body.bytesize h else super end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
m2r-2.1.0.pre | lib/m2r/response/content_length.rb |
m2r-2.0.2 | lib/m2r/response/content_length.rb |
m2r-2.0.1 | lib/m2r/response/content_length.rb |
m2r-2.0.0 | lib/m2r/response/content_length.rb |