product-apim icon indicating copy to clipboard operation
product-apim copied to clipboard

API Manager can't handle paths with forward slash at the end when there is question mark '?' immediately after it (query params)

Open RichardSufliarsky opened this issue 2 years ago • 2 comments

Description:

API Manager can't handle paths like /foo/ (ending with forward slash) when combined with query parameters in request (question mark immediately follows after forward slash). It is strange that it can handle path / with question mark right after it. It works for this request: https://localhost:8243/ipify/1.0.0/?format=json But fails for this request: https://localhost:8243/ipify/1.0.0/ERROR/?format=json

Message in log: INFO - LogMediator {api:ipify:v1.0.0} STATUS = Executing default 'fault' sequence, ERROR_CODE = 404, ERROR_MESSAGE = No matching resource found for given API Request

Response body in Devportal or when testing in Publisher:

{
  "code": "404",
  "type": "Status report",
  "message": "Runtime Error",
  "description": "No matching resource found for given API Request"
}

Steps to reproduce:

In Publisher create API based on this definition: ipify.yaml.txt Call first GET '/' method and it works. Call second GET '/ERROR/' method and it fails with described error.

Affected Product Version:

docker.io/wso2/wso2am:4.0.0

Environment details (with versions):

  • OS: RHEL 8.5
  • Client:
  • Env (Docker/K8s): Podman

RichardSufliarsky avatar Apr 06 '22 23:04 RichardSufliarsky

I have same problem

mrezaabqr avatar May 29 '22 09:05 mrezaabqr

We have the same problem on some endpoints like this

[https://localhost:8243/api/sections/180/?all_objects=true]

{
    "code": "404",
    "type": "Status report",
    "message": "Runtime Error",
    "description": "No matching resource found for given API Request"
}

sogand145 avatar May 29 '22 09:05 sogand145

Update [2022-12-02]

Tested the above PR changes for Synapse with product-apim and carbon-apimgt.

Noticed that the current Synapse version (4.0.0-wso2v1) is not working properly. Got informed that a fixing PR for that will be sent sooner. Since local Synapse was rebased for the current one, had to checked out for 2.1.7-wso2v314 tag to do the testing.

Tested Versions

carbon.apimgt > 9.28.7-SNAPSHOT carbon.mediation > 4.7.143 synapse > 2.1.7-wso2v314 (Above change included)

Testing was done with above previous versions to get the product run properly. Created APIs using PizzaShack Mock API, a Normal API from scratch, using import WSDL snd tried them out. Then using Mockoon tool, an API was tested with different resource combinations. Test results were a success.

piyumaldk avatar Dec 02 '22 09:12 piyumaldk