lib/cuba_api/write_aspect.rb in cuba-api-0.2.0 vs lib/cuba_api/write_aspect.rb in cuba-api-0.3.0

- old
+ new

@@ -38,11 +38,12 @@ self[ :aspects ] ||= [] end end def head( status ) - res.status = status - res.write '' + res.status = Rack::Utils.status_code( status ) + res.write Rack::Utils::HTTP_STATUS_CODES[ res.status ] + res['Content-Type' ] = 'text/plain' end def write( obj, options = {} ) self.res.status = options[:status] || 200 # make sure we inherit aspects and repsect the order