Tyk API appends at end of URL instead of 404

Hey, I have written an upstream with proxy as

“proxy”:{
“listen_path”: “/api/v1/devices”,
“target_url”: “http://sit-svc-provision-api:8085”,
“strip_listen_path”: false
},

when I run curl http://host/api/v1/devicesWHATEVER, the url is found, and its calling the service like http://host/api/v1/devices/WHATEVER when I expect it to return 404

how can I overcome this?

Hi,

You have set listen_path to /api/v1/devices without trailing /. So when you call http://host/api/v1/devicesWHATEVER, WHATEVER is considered as a query string.

If you don’t want this behavior just put trailing / in listen_path.