lib/peddler/parser.rb in peddler-0.7.6 vs lib/peddler/parser.rb in peddler-0.7.7
- old
+ new
@@ -9,13 +9,13 @@
# Amazon developers
def parse(res, encoding = 'ISO-8859-1')
# Don't parse if there's no body
return res unless res.body
- case res.headers['Content-Type']
- when 'text/xml'
+ content_type = res.headers['Content-Type']
+ if content_type.start_with?('text/xml')
XMLParser.new(res)
- when 'application/octet-stream'
+ elsif content_type == 'application/octet-stream'
FlatFileParser.new(res, encoding)
else
raise NotImplementedError
end
end