diff options
author | Stormwind <stormwind@stormwinds-page.de> | 2012-11-23 17:43:39 +0100 |
---|---|---|
committer | Stormwind <stormwind@stormwinds-page.de> | 2012-11-23 17:43:39 +0100 |
commit | 963adb8ddca4c0a5470deaa50ca5f115ed7b0f94 (patch) | |
tree | 450b620738dad747ba4f38eaf29312d094d6c4ff /lib | |
parent | 2b79c3e840bc45eaebffedfd17edafd2c313bbb3 (diff) |
content_length sets the Content-Length to 0
The method content_length creates a header named Content-Length and sets
its value to 0.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zero/response.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/zero/response.rb b/lib/zero/response.rb index 74b2e28..85e7469 100644 --- a/lib/zero/response.rb +++ b/lib/zero/response.rb @@ -38,5 +38,12 @@ module Zero [@status, @header, @body] end + # Sets the content length header to the current length of the body + # Also creates one, if it does not exists + # + def content_length + header['Content-Length'] = 0 + end + end end |