From 78ffc8b0a8611754fbacef0961b59f6ad664a6ec Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 14 Sep 2012 14:52:18 +0200 Subject: [PATCH] Bug #1472: Set content type correctly in Sunstone (cherry picked from commit 128e5c210ebc112f6886a385bba7d3213e14f8f5) --- src/sunstone/sunstone-server.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 9999b27713..fa5dd535c8 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -183,6 +183,7 @@ end before do cache_control :no_store + content_type 'application/json', :charset => 'utf-8' unless request.path=='/login' || request.path=='/' halt 401 unless authorized? @@ -218,6 +219,7 @@ end # HTML Requests ############################################################################## get '/' do + content_type 'text/html', :charset => 'utf-8' if !authorized? return erb :login end @@ -239,6 +241,7 @@ get '/' do end get '/login' do + content_type 'text/html', :charset => 'utf-8' if !authorized? erb :login end @@ -290,6 +293,7 @@ post '/config' do when "wss" then session[:wss] = value end end + [204,""] end get '/vm/:id/log' do