iilyak commented on a change in pull request #3568:
URL: https://github.com/apache/couchdb/pull/3568#discussion_r633793075



##########
File path: src/chttpd/src/chttpd_cors.erl
##########
@@ -207,67 +218,64 @@ maybe_apply_headers(CorsHeaders, RequestHeaders, 
ExposedCouchHeaders) ->
     %% need to be exposed.
     %% return: RequestHeaders ++ CorsHeaders ++ ACEH
 
-    ExposedHeaders0 = simple_headers([K || {K,_V} <- RequestHeaders]),
+    ExposedHeaders0 = simple_headers([K || {K, _V} <- RequestHeaders]),
 
     %% If Content-Type is not in ExposedHeaders, and the Content-Type
     %% is not a member of ?SIMPLE_CONTENT_TYPE_VALUES, then add it
     %% into the list of ExposedHeaders
     ContentType = proplists:get_value("content-type", ExposedHeaders0),
-    IncludeContentType = case ContentType of
-        undefined ->
-            false;
-        _ ->
-            lists:member(string:to_lower(ContentType), 
?SIMPLE_CONTENT_TYPE_VALUES)
+    IncludeContentType =
+        case ContentType of
+            undefined ->
+                false;
+            _ ->
+                lists:member(string:to_lower(ContentType), 
?SIMPLE_CONTENT_TYPE_VALUES)
         end,
-    ExposedHeaders = case IncludeContentType of
-        false ->
-            ["content-type" | lists:delete("content-type", ExposedHeaders0)];
-        true ->
-            ExposedHeaders0
+    ExposedHeaders =
+        case IncludeContentType of
+            false ->
+                ["content-type" | lists:delete("content-type", 
ExposedHeaders0)];
+            true ->
+                ExposedHeaders0
         end,
 
     %% ExposedCouchHeaders may get added later, so expose them by default
-    ACEH = [{"Access-Control-Expose-Headers",
-        string:join(ExposedHeaders ++ ExposedCouchHeaders, ", ")}],
+    ACEH = [

Review comment:
       +2




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to