token
and my naive split by space code cannot find the token part due to extra spaces, should I return 400 or 500 or 401?
Why not just fix your naive split by space code?
it's simpler to split
The standard only allows one space
400 Bad Request, or 422 Unprocessable Entity
Actually, you wouldn't know if it's an unprocessable entity, you'd only know it's an invalid token
now that's even better. I will capitalize the error message since I have an opportunity to blame the user(once in a lifetime)
I think it's very uncommon to make this mistake lel
one can never trust any user input. Some humans are aweful
https://tools.ietf.org/html/rfc6750#section-2.1 https://tools.ietf.org/html/rfc2617#section-2
Обсуждают сегодня