🚧 Dont drop prefix
This commit is contained in:
parent
30dc6811c9
commit
7a19f9f2dc
@ -59,7 +59,7 @@ public class ProxyResource
|
|||||||
public void proxy(@Context RoutingContext context)
|
public void proxy(@Context RoutingContext context)
|
||||||
{
|
{
|
||||||
HttpServerRequest request = context.request();
|
HttpServerRequest request = context.request();
|
||||||
|
System.out.println(request.path());
|
||||||
List<String> requestSegments = PathConverter.toSegments(request.path());
|
List<String> requestSegments = PathConverter.toSegments(request.path());
|
||||||
|
|
||||||
Optional<ProxyRoute> routeOptional = routeService.match(requestSegments);
|
Optional<ProxyRoute> routeOptional = routeService.match(requestSegments);
|
||||||
@ -69,8 +69,7 @@ public class ProxyResource
|
|||||||
LOG.info("Matched route with target '{}'", route.target());
|
LOG.info("Matched route with target '{}'", route.target());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String targetPath = PathConverter.toPath(dropPrefix(route.segments(), requestSegments));
|
String targetURI = route.target() + PathConverter.toPath(requestSegments);
|
||||||
String targetURI = route.target() + targetPath;
|
|
||||||
HttpResponse<byte[]> response = forwardService.send(context, targetURI, route.strategy());
|
HttpResponse<byte[]> response = forwardService.send(context, targetURI, route.strategy());
|
||||||
ResponseHandler.success(context, response);
|
ResponseHandler.success(context, response);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,6 @@ routes:
|
|||||||
- path: /api
|
- path: /api
|
||||||
target: http://localhost:8081
|
target: http://localhost:8081
|
||||||
strategy: OIDC
|
strategy: OIDC
|
||||||
- path: /example
|
- path: /
|
||||||
target: http://example.com
|
target: http://example.com
|
||||||
strategy: OIDC
|
strategy: NONE
|
||||||
Loading…
x
Reference in New Issue
Block a user