Project

General

Profile

Actions

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.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
API
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

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

Actions #1

Updated by Nicolas CHARLES about 3 years ago

  • 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)
Actions #2

Updated by Nicolas CHARLES about 3 years ago

  • Description updated (diff)
Actions #3

Updated by Nicolas CHARLES about 3 years ago

  • Target version set to 6.2.12
Actions #4

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 6.2.12 to 6.2.13
Actions #5

Updated by Benoît PECCATTE almost 3 years ago

  • Category set to API
Actions #6

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.2.13 to 6.2.14
Actions #7

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.2.14 to 6.2.15
Actions #8

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.2.15 to 6.2.16
Actions #9

Updated by Alexis Mousset over 2 years ago

  • Target version changed from 6.2.16 to 6.2.17
Actions #10

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 6.2.17 to 997
Actions #11

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 997 to 6.2.18
Actions #12

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 6.2.18 to 6.2.19
Actions #13

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 6.2.19 to 6.2.20
Actions #14

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 6.2.20 to old 6.2 issues to relocate
Actions #15

Updated by François ARMAND over 1 year 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 --fail-with-body parameter

Actions

Also available in: Atom PDF