You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2018/06/22 22:15:54 UTC

[couchdb] 25/31: Allow tests to specify the request Content-Type

This is an automated email from the ASF dual-hosted git repository.

chewbranca pushed a commit to branch elixir-suite
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 1d97b3586354423362f8005704c883acfe2077c8
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Fri Dec 15 12:31:12 2017 -0600

    Allow tests to specify the request Content-Type
---
 test/elixir/lib/couch.ex | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/elixir/lib/couch.ex b/test/elixir/lib/couch.ex
index 8f0aca9..8ad4821 100644
--- a/test/elixir/lib/couch.ex
+++ b/test/elixir/lib/couch.ex
@@ -10,9 +10,12 @@ defmodule Couch do
   end
 
   def process_request_headers(headers) do
-    headers
-    |> Dict.put(:"User-Agent", "couch-potion")
-    |> Dict.put(:"Content-Type", "application/json")
+    headers = Keyword.put(headers, :"User-Agent", "couch-potion")
+    if headers[:"Content-Type"] do
+      headers
+    else
+      Keyword.put(headers, :"Content-Type", "application/json")
+    end
   end
 
   def process_options(options) do