couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [couchdb] 25/31: Allow tests to specify the request Content-Type
Date Fri, 22 Jun 2018 22:15:54 GMT
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 <paul.joseph.davis@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


Mime
View raw message