Skip to content

Commit

Permalink
Fix 404 errors for APIs when enabling MetricHandler
Browse files Browse the repository at this point in the history
Fix 404 errors for APIs when enabling MetricHandler. Fixes- #3082
  • Loading branch information
DedunuKarunarathne committed Feb 1, 2024
1 parent 7fd05f7 commit 74a9200
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,11 @@ private void incrementInboundEndpointErrorCount(String name) {
private String getApiName(String contextPath, MessageContext synCtx) {
String apiName = null;
for (API api : synCtx.getEnvironment().getSynapseConfiguration().getAPIs()) {
if (RESTUtils.matchApiPath(contextPath, api.getContext())) {
String apiContextPath = api.getContext();
if (api.getVersionStrategy().getVersion() != null) {
apiContextPath = apiContextPath + "/" + api.getVersionStrategy().getVersion();
}
if (RESTUtils.matchApiPath(contextPath, apiContextPath)) {
apiName = api.getName();
synCtx.setProperty(RESTConstants.PROCESSED_API, api);
// if we match to a versioned API, search should stop.
Expand Down

0 comments on commit 74a9200

Please sign in to comment.