Skip to content

Commit

Permalink
Fix response header is not Array for ruby 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
krekoten committed Sep 22, 2010
1 parent a90eff5 commit 074b925
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/octopi/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ def submit(path, params = {}, klass=nil, format = :yaml, &block)

# It happens, in tests.
return resp if resp.headers.empty?
ctype = resp.headers['content-type'].first.split(";").first
content_type = Array === resp.headers['content-type'] ? resp.headers['content-type'] : [resp.headers['content-type']]
ctype = content_type.first.split(";").first
raise FormatError, [ctype, format] unless CONTENT_TYPE[format.to_s].include?(ctype)
if format == 'yaml' && resp['error']
raise APIError, resp['error']
Expand Down

0 comments on commit 074b925

Please sign in to comment.