Render strings as text/plain
This commit is contained in:
parent
c1db39610e
commit
a926ac1945
|
@ -10,18 +10,22 @@ module Travis::Api::App::Responders
|
||||||
# for log's content for now.
|
# for log's content for now.
|
||||||
#
|
#
|
||||||
# TODO: think how to handle other formats correctly
|
# TODO: think how to handle other formats correctly
|
||||||
super && resource.is_a?(Log)
|
super && (resource.is_a?(Log) || resource.is_a?(String))
|
||||||
end
|
end
|
||||||
|
|
||||||
def apply
|
def apply
|
||||||
super
|
super
|
||||||
|
|
||||||
|
if resource.is_a?(Log)
|
||||||
filename = resource.id
|
filename = resource.id
|
||||||
disposition = params[:attachment] ? 'attachment' : 'inline'
|
disposition = params[:attachment] ? 'attachment' : 'inline'
|
||||||
|
|
||||||
headers['Content-Disposition'] = %(#{disposition}; filename="#{filename}")
|
headers['Content-Disposition'] = %(#{disposition}; filename="#{filename}")
|
||||||
|
|
||||||
params[:deansi] ? clear_ansi(resource.content) : resource.content
|
params[:deansi] ? clear_ansi(resource.content) : resource.content
|
||||||
|
else
|
||||||
|
resource
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in New Issue
Block a user