Skip to content

Commit

Permalink
Merge pull request #3099 from DedunuKarunarathne/fix-404
Browse files Browse the repository at this point in the history
Fix 404 errors for APIs when enabling MetricHandler
  • Loading branch information
chanikag authored Jun 19, 2024
2 parents 2206450 + 74a9200 commit e032de0
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 e032de0

Please sign in to comment.