Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring cloud 2021.0.2 openfeign RequestInterceptor sets the request header and loses some strings #711

Closed
thousmile opened this issue May 8, 2022 · 3 comments
Labels
question Further information is requested

Comments

@thousmile
Copy link

thousmile commented May 8, 2022

test code

cloud-demo-2.zip

spring cloud 2020.0.5 spring boot 2.5.13 openfeign everything is normal

image

2022-05-08 13:58:41.706 INFO 984 --- [io-19888-exec-1] kenInterceptor$RpcTokenServerInterceptor : tokenValueStr: {"createTime":"1651989521489","tokenId":"4g0li88nzo"}

image

2022-05-08 13:58:41.499 INFO 4916 --- [pool-2-thread-1] kenInterceptor$RpcTokenClientInterceptor : tokenValueStr: {"createTime":"1651989521489","tokenId":"4g0li88nzo"}

spring cloud 2021.0.2 spring boot 2.6.7 It is found that the class data is missing

image

2022-05-08 14:06:40.599 INFO 16296 --- [pool-2-thread-1] kenInterceptor$RpcTokenClientInterceptor : tokenValueStr: {"createTime":"1651990000591","tokenId":"io6dqczz6k"}

image

2022-05-08 14:06:40.822 INFO 7580 --- [io-19888-exec-1] kenInterceptor$RpcTokenServerInterceptor : tokenValueStr: {"createTime":"1651990000591","tokenId"}
2022-05-08 14:06:40.833 ERROR 7580 --- [io-19888-exec-1] com.xaaef.cloud.rest.util.JsonUtils : Unexpected character ('}' (code 125)): was expecting a colon to separate field name and value
at [Source: (String)"{"createTime":"1651990000591","tokenId"}"; line: 1, column: 41]
2022-05-08 14:06:40.833 INFO 7580 --- [io-19888-exec-1] kenInterceptor$RpcTokenServerInterceptor : tokenValue: null

{"createTime":"1651990000591","tokenId"}

@misselvexu
Copy link

Reference to Feign#ISSUES-1305 .

@misselvexu
Copy link

@thousmile Using URLEncoder to wrap your target value temporarily .

@thousmile
Copy link
Author

@misselvexu Thanks! Have not used request headers for encoding before!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants