From 5d6319dfcc78079b06cd6072aa37e84e80581fdb Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Fri, 14 Feb 2014 16:57:05 +0800 Subject: [PATCH] Updated Store headers to work with nginx --- config/store_config.yml | 4 ++-- lib/store.rb | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/store_config.yml b/config/store_config.yml index a56920b..f591dc0 100644 --- a/config/store_config.yml +++ b/config/store_config.yml @@ -1,3 +1,3 @@ store_settings: - url: "http://192.168.1.250:3000/api" - api_key: 'Token token="b38ba5f588a7c5072e88ee15737a4d33"' + url: "http://store.tp.rulingcom.com/api" + api_key: 'Token token="2870f77e59168dbe3fbdffba466c7c8d"' diff --git a/lib/store.rb b/lib/store.rb index 57a9f9a..a7db8b7 100644 --- a/lib/store.rb +++ b/lib/store.rb @@ -9,24 +9,25 @@ class Store @options_for_get = { headers: { "Authorization" => api_key, - "X_SiteToken" => site_token, - "X_SiteId" => site_id, - "Content-Type" => "application/json" + "X-SiteToken" => site_token, + "X-SiteId" => site_id, + "Content-Type" => "application/json", + 'Accept' => 'application/json' } } @options_for_client = { headers: { "Authorization" => api_key, - "Content-Type" => "application/json" + "Content-Type" => "application/json", + 'Accept' => 'application/json' } } end def templates(options={}) options = @options_for_get - response = self.class.get('/templates', options) - puts response.request.last_uri.to_s + self.class.get('/templates', options) end def extensions(options={})