Skip to content

Commit 3ba7f5f

Browse files
AXIS2-6073, fix HTTPS support by getting 'scheme' from URI instance
1 parent 8729044 commit 3ba7f5f

File tree

1 file changed

+9
-1
lines changed
  • modules/transport/http/src/main/java/org/apache/axis2/transport/http/impl/httpclient5

1 file changed

+9
-1
lines changed

modules/transport/http/src/main/java/org/apache/axis2/transport/http/impl/httpclient5/RequestImpl.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,19 @@ final class RequestImpl implements Request {
103103
}
104104
int port = requestUri.getPort();
105105
String protocol;
106+
// AXIS2-6073
107+
// This may always be null here, HttpUriRequestBase has the scheme but is unused?
108+
// And also, protocol doesn't need to be set on HttpUriRequestBase?
106109
if (this.httpRequestMethod.getVersion() != null && this.httpRequestMethod.getVersion().getProtocol() != null) {
107110
protocol = this.httpRequestMethod.getVersion().getProtocol();
111+
log.debug("Received protocol from this.httpRequestMethod.getVersion().getProtocol(): " + protocol);
112+
} else if (requestUri.getScheme() != null) {
113+
protocol = requestUri.getScheme();
114+
log.debug("Received protocol from requestUri.getScheme(): " + protocol);
108115
} else {
109116
protocol = "http";
110-
}
117+
log.warn("Cannot find protocol, using default as http on requestUri: " + requestUri);
118+
}
111119
if (port == -1) {
112120
if (HTTPTransportConstants.PROTOCOL_HTTP.equals(protocol)) {
113121
port = 80;

0 commit comments

Comments
 (0)