You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/10/10 10:05:02 UTC

camel git commit: CAMEL-9205: cors headers should use set and not add to avoid multi values.

Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x ae9f2910f -> f233f53b8


CAMEL-9205: cors headers should use set and not add to avoid multi values.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f233f53b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f233f53b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f233f53b

Branch: refs/heads/camel-2.15.x
Commit: f233f53b845295446bbf72bac27dc74f4c49d77b
Parents: ae9f291
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Oct 10 09:49:36 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Oct 10 10:06:46 2015 +0200

----------------------------------------------------------------------
 .../swagger/RestSwaggerApiDeclarationServlet.scala      | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f233f53b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala
----------------------------------------------------------------------
diff --git a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala
index 038f18f..c10bdb3 100644
--- a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala
+++ b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala
@@ -160,9 +160,9 @@ abstract class RestSwaggerApiDeclarationServlet extends HttpServlet {
     val headers = Map[String, List[String]]()
 
     if (cors) {
-      response.addHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers")
-      response.addHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH")
-      response.addHeader("Access-Control-Allow-Origin", "*")
+      response.setHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers")
+      response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH")
+      response.setHeader("Access-Control-Allow-Origin", "*")
     }
 
     val rests = getRestDefinitions(camelId)
@@ -205,9 +205,9 @@ abstract class RestSwaggerApiDeclarationServlet extends HttpServlet {
     val pathPart = docRoot
 
     if (cors) {
-      response.addHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers")
-      response.addHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH")
-      response.addHeader("Access-Control-Allow-Origin", "*")
+      response.setHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers")
+      response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH")
+      response.setHeader("Access-Control-Allow-Origin", "*")
     }
 
     val rests = getRestDefinitions(camelId)