cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7347] Reverting a dynamic host check with Swagger 3.0.7 now correctly dealing with it
Date Wed, 26 Apr 2017 10:01:21 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 6c6cdd22e -> 1221b873a


[CXF-7347] Reverting a dynamic host check with Swagger 3.0.7 now correctly dealing with it


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

Branch: refs/heads/master
Commit: 1221b873a1a17decd5a65e7d71cce8a0830e0f8b
Parents: 6c6cdd2
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Apr 26 11:01:06 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Apr 26 11:01:06 2017 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/swagger/DefaultSwagger2Serializers.java    | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1221b873/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/DefaultSwagger2Serializers.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/DefaultSwagger2Serializers.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/DefaultSwagger2Serializers.java
index 8048fa1..18f5cda 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/DefaultSwagger2Serializers.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/DefaultSwagger2Serializers.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
-import java.net.URI;
 import java.net.URL;
 import java.util.Collections;
 import java.util.Comparator;
@@ -74,10 +73,8 @@ public class DefaultSwagger2Serializers extends SwaggerSerializers implements
Sw
             final MultivaluedMap<String, Object> headers,
             final OutputStream out) throws IOException {
 
-        MessageContext ctx = null;
-                                                   
         if (dynamicBasePath) {
-            ctx = createMessageContext();
+            MessageContext ctx = createMessageContext();
             String currentBasePath = StringUtils.substringBeforeLast(ctx.getHttpServletRequest().getRequestURI(),
"/");
             if (!currentBasePath.equals(beanConfig.getBasePath())) {
                 data.setBasePath(currentBasePath);
@@ -90,12 +87,6 @@ public class DefaultSwagger2Serializers extends SwaggerSerializers implements
Sw
                 data.setSecurityDefinitions(beanConfig.getSwagger().getSecurityDefinitions());
             }
         }
-        if (data.getHost() == null) {
-            ctx = ctx == null ? createMessageContext() : ctx;
-            URI uri = ctx.getUriInfo().getAbsolutePath();
-            String authority = uri.getAuthority();
-            data.setHost(authority);
-        }
 
         if (replaceTags || javadocProvider != null) {
             Map<String, ClassResourceInfo> operations = new HashMap<>();


Mime
View raw message