Skip to content

Commit

Permalink
Merge pull request #2545 from Tharsanan1/fix-redirect
Browse files Browse the repository at this point in the history
Fix redirect request flow
  • Loading branch information
Tharsanan1 authored Oct 7, 2024
2 parents cbcad45 + bacebe8 commit b965168
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,15 @@ public void handleSuccessRequest(RequestContext requestContext) {
public String resolveEndpoint(RequestContext requestContext) {

// For MockAPIs there is no backend, Hence "MockImplementation" is added as the destination.
if (requestContext.getMatchedAPI().isMockedApi()) {
if (requestContext.getMatchedAPI() != null && requestContext.getMatchedAPI().isMockedApi()) {
return "MockImplementation";
}
// This does not cause problems at the moment Since the current microgateway supports only one URL
return requestContext.getMatchedResourcePaths().get(0).getEndpoints().getUrls().get(0);
try {
return requestContext.getMatchedResourcePaths().get(0).getEndpoints().getUrls().get(0);
} catch (Exception e) {
return "";
}
}

public void handleFailureRequest(RequestContext requestContext) {
Expand Down

0 comments on commit b965168

Please sign in to comment.