Bug #20054
closed
if token is invalid, there is no error when doing a PUT
Added by Nicolas CHARLES about 3 years ago.
Updated over 1 year ago.
Description
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
- Project changed from 81 to Rudder
- Subject changed from if token is invalid, there is no error when creating a node to if token is invalid, there is no error when doing a PUT
- Description updated (diff)
- Target version deleted (
7.0-1.6)
- Description updated (diff)
- Target version set to 6.2.12
- Target version changed from 6.2.12 to 6.2.13
- Target version changed from 6.2.13 to 6.2.14
- Target version changed from 6.2.14 to 6.2.15
- Target version changed from 6.2.15 to 6.2.16
- Target version changed from 6.2.16 to 6.2.17
- Target version changed from 6.2.17 to 997
- Target version changed from 997 to 6.2.18
- Target version changed from 6.2.18 to 6.2.19
- Target version changed from 6.2.19 to 6.2.20
- Target version changed from 6.2.20 to old 6.2 issues to relocate
- 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 --fail-with-body
parameter
Also available in: Atom
PDF