Skip to content

Commit

Permalink
Respect the node port while configuring downstream request (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
3ldar authored Jan 30, 2024
1 parent 01e6229 commit e3cffd1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ private void SetDownStreamRequestUri(Node node, string requestPath, string query
uriBuilder = new UriBuilder(node.Address + requestPath + queryString);
else
uriBuilder = new UriBuilder("http://", node.Address, node.Port, requestPath, queryString);

if (node.Port > 0)
uriBuilder.Port = node.Port;

DownstreamRequest.RequestUri = uriBuilder.Uri;
}

Expand All @@ -158,4 +162,4 @@ private static void AddHeaderIfDoesntExist(HttpContext context,
context.Response.Headers.Add(httpResponseHeader.Key,
new StringValues(httpResponseHeader.Value.ToArray()));
}
}
}

0 comments on commit e3cffd1

Please sign in to comment.