Switch content_type param order for 1.8
This commit is contained in:
parent
7bd5ed1344
commit
380dac270d
|
@ -427,7 +427,7 @@ module Middleman
|
||||||
self.current_path = request_path.dup
|
self.current_path = request_path.dup
|
||||||
|
|
||||||
# Set a HTTP content type based on the request's extensions
|
# Set a HTTP content type based on the request's extensions
|
||||||
content_type(resource.mime_type, env)
|
content_type(res, resource.mime_type)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
# Write out the contents of the page
|
# Write out the contents of the page
|
||||||
|
@ -504,7 +504,7 @@ module Middleman
|
||||||
extension = File.extname(path)
|
extension = File.extname(path)
|
||||||
matched_mime = mime_type(extension)
|
matched_mime = mime_type(extension)
|
||||||
matched_mime = "application/octet-stream" if matched_mime.nil?
|
matched_mime = "application/octet-stream" if matched_mime.nil?
|
||||||
content_type matched_mime, res
|
content_type res, matched_mime
|
||||||
|
|
||||||
file = ::Rack::File.new nil
|
file = ::Rack::File.new nil
|
||||||
file.path = path
|
file.path = path
|
||||||
|
@ -518,7 +518,7 @@ module Middleman
|
||||||
# @param [String] type Content type
|
# @param [String] type Content type
|
||||||
# @param [Hash] params
|
# @param [Hash] params
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def content_type(type = nil, params={}, res)
|
def content_type(res, type = nil, params={})
|
||||||
return res['Content-Type'] unless type
|
return res['Content-Type'] unless type
|
||||||
default = params.delete :default
|
default = params.delete :default
|
||||||
mime_type = mime_type(type) || default
|
mime_type = mime_type(type) || default
|
||||||
|
|
Loading…
Reference in a new issue