From cb21b01053cd8dcc8191bd8acee49752c40c28c4 Mon Sep 17 00:00:00 2001 From: Max De Marzi Date: Thu, 30 Jan 2014 21:22:25 -0600 Subject: [PATCH] allow headers to be past in when using extensions --- lib/neography/rest.rb | 4 ++-- lib/neography/rest/extensions.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/neography/rest.rb b/lib/neography/rest.rb index 219ec1e..2b1d414 100644 --- a/lib/neography/rest.rb +++ b/lib/neography/rest.rb @@ -437,8 +437,8 @@ def execute_script(script, params = {}) # unmanaged extensions - def post_extension(path, params = {}) - @extensions.post(path, params) + def post_extension(path, params = {}, headers = nil) + @extensions.post(path, params, headers) end def get_extension(path) diff --git a/lib/neography/rest/extensions.rb b/lib/neography/rest/extensions.rb index ff02e65..4bed2bd 100644 --- a/lib/neography/rest/extensions.rb +++ b/lib/neography/rest/extensions.rb @@ -11,10 +11,10 @@ def get(path) @connection.get(path) end - def post(path, body = {}) + def post(path, body = {}, headers = nil) options = { :body => body.to_json, - :headers => json_content_type.merge({'Accept' => 'application/json;stream=true'}) + :headers => headers || json_content_type.merge({'Accept' => 'application/json;stream=true'}) } @connection.post(path, options)