0

In below request, second header is having space which is causing the issue. If we remove it and hit the API it works fine otherwise 400 bad request error.

The same curl was working until 1.17 NGINX version, but after that we are facing the issue. Please suggest any solution for it

Request:

curl -ks --location --request GET 'https://<hostname>/employees' \
> --header 'emp_id: 110' \
> --header 'abcd xyz: hello'

Response:

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.23.2</center>
</body>
</html>
Vikram R
  • 99
  • 2
  • 9
  • Whitespaces in headers are not allowed per RFC. https://www.rfc-editor.org/rfc/rfc7230#section-3.2 I think it broke with this release: Changes with nginx 1.21.1 06 Jul 2021 *) Change: now nginx always returns an error if spaces or control characters are used in a header name. The solution is to fix API to make it conform to standard and not use whitespace in the header name. Please feel free to ask any additional questions. – Vikram R Jan 10 '23 at 06:09

0 Answers0