Spring Boot request header return null value

后端 未结 2 756
难免孤独
难免孤独 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:18

    Some network tools can drop headers that contain underscore in it's name. As per this answer underscore is a legal character but it's uncommon and sometimes tools require additional configuration to support it.

    Rename your header to requestDate or request-date and see if it helps. If it works without underscore than inspect network route between client and server e.g. maybe there is a proxy that drops them?

提交回复
热议问题