From 16eef08688a50b31239cd67080439e8e6dead4a2 Mon Sep 17 00:00:00 2001 From: Stormwind Date: Fri, 23 Nov 2012 19:54:17 +0100 Subject: content_type sets the Content-Type header to the given value --- lib/zero/response.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/zero/response.rb b/lib/zero/response.rb index eec4559..0d23194 100644 --- a/lib/zero/response.rb +++ b/lib/zero/response.rb @@ -46,5 +46,12 @@ module Zero header['Content-Length'] = body.join.bytesize end + # Sets the content type to the given value + # Also creates it, if it does not exists + # + def content_type(value) + header['Content-Type'] = value + end + end end -- cgit v1.2.3-70-g09d2