200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
# File 'actionpack/lib/action_dispatch/http/mime_type.rb', line 200
def parse()
if !.include?(",")
if (index = .index(PARAMETER_SEPARATOR_REGEXP))
= [0, index].strip
end
return [] if .blank?
parse_trailing_star() || Array(Mime::Type.lookup())
else
list, index = [], 0
.scan(ACCEPT_HEADER_REGEXP).each do ||
params, q = .split(PARAMETER_SEPARATOR_REGEXP)
next unless params
params.strip!
next if params.empty?
params = parse_trailing_star(params) || [params]
params.each do |m|
list << AcceptItem.new(index, m.to_s, q)
index += 1
end
end
AcceptList.sort! list
end
end
|