if token is invalid, there is no error when doing a PUT
using the token from the example
[root@server share]# curl -k -H "X-API-Token: 5YJnb4EenqDHzwx0U0eTPWWhgjTJ8mkk" -H "Content-Type: application/json" -X PUT 'https://localhost/rudder/api/latest/createnode' -d@/tmp/json.json [root@server share]# echo $? 0
but the webapp log say
[2021-10-04 19:50:01+0000] WARN application - REST authentication failed from IP '127.0.0.1|X-Forwarded-For:::1'. Error was: Inconsistency: No registered token '5YJnb4EenqDHzwx0U0eTPWWhgjTJ8mkk'
GET & POST are ok
Updated by François ARMAND 7 months ago
- Status changed from New to Rejected
- Regression set to No
This is the expected behavior of curl, it returns 0 if the request was correctly processed, whatever the HTTP code.
If you want to get curl to fail on 4xx and 5xx response, you need to use