Spring Boot request header return null value

后端 未结 2 1025
难免孤独
难免孤独 2021-02-20 06:33

I have a spring boot project which has some Rest APIs in it. I have two custom headers named request_date and tenant

2条回答
  •  星月不相逢
    2021-02-20 07:29

    The issue was with the nginx configuration.

    I set the underscores_in_headers on; for the server and now it doesn't drop the headers with underscore in their names.

    The solution suggested by @Karol Dowbecki works as well. When I renamed my header to requestDate, I was able to read the value successfully.

提交回复
热议问题