lib/httpi/response.rb in httpi-1.0.0 vs lib/httpi/response.rb in httpi-1.1.0
- old
+ new
@@ -1,8 +1,9 @@
require "zlib"
require "stringio"
require "httpi/dime"
+require "httpi/cookie"
require "rack/utils"
module HTTPI
# = HTTPI::Response
@@ -28,9 +29,14 @@
end
# Returns whether the HTTP response is a multipart response.
def multipart?
!!(headers["Content-Type"] =~ /^multipart/i)
+ end
+
+ # Returns a list of cookies from the response.
+ def cookies
+ @cookies ||= Cookie.list_from_headers(headers)
end
# Returns any DIME attachments.
def attachments
decode_body unless @body