./lib/dolt/sinatra/actions.rb in dolt-0.26.0 vs ./lib/dolt/sinatra/actions.rb in dolt-0.27.0

- old
+ new

@@ -33,10 +33,13 @@ app.response["Location"] = url app.body("") end def render_error(error, repo, ref, data = {}) + $stderr.puts(error.message) + $stderr.puts(error.backtrace) + if error.class.to_s == "Rugged::ReferenceError" && ref == "HEAD" return app.body(renderer.render("empty", { :repository => repo, :ref => ref }.merge(data))) @@ -174,16 +177,16 @@ CGI.unescape(str.gsub("+", "\001")).gsub("\001", '+') end def add_headers(response, headers = {}) default_ct = "text/html; charset=utf-8" - response["Content-Type"] = headers[:content_type] || default_ct - response["X-UA-Compatible"] = "IE=edge" + app.response["Content-Type"] = headers[:content_type] || default_ct + app.response["X-UA-Compatible"] = "IE=edge" if headers[:ref] && headers[:ref].length == 40 - response["Cache-Control"] = "max-age=315360000, public" + app.response["Cache-Control"] = "max-age=315360000, public" year = 60*60*24*365 - response["Expires"] = (Time.now + year).httpdate + app.response["Expires"] = (Time.now + year).httpdate end end end end end