Skip to content

Commit

Permalink
fix protocol parsing in zuul filter
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Dec 12, 2018
1 parent 97ac396 commit acbe60a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/ao/adrestia/filters/RoutingFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ public Object run() {

// Determine the protocol of the request
String originalUrl = context.getRequest().getRequestURL().toString();
String[] originalUrlSplitList = originalUrl.split(":", 1);
String[] originalUrlSplitList = originalUrl.split(":", 2);
String routedProtocol = "";
if (originalUrlSplitList.length > 0) {
routedProtocol = originalUrlSplitList[0];
}

try {
// Set the URL of the request to a new URL with the existing protocol
log.info("Returning final URL {}://{}:{}/{}", routedProtocol, hostname, port, newTail);
Expand Down

0 comments on commit acbe60a

Please sign in to comment.