Skip to content

upgrade spring-cloud-release from F to G, feign urlencode error #879

@dragontree101

Description

@dragontree101

upgrade spring-cloud-release from F to G, feign urlencode error

my app server code is

 @PostMapping(value = "/user/userinfo")
    public BaseResult userInfoSignatureCheck(
            @NotBlank @RequestHeader(WxConstants.HN_APP_ID) String hnAppId,
            @NotBlank @RequestParam(WxConstants.SESSION_KEY) String sessionKey,
            @NotBlank @RequestParam String rawData,
            @NotBlank @RequestParam String signature,
            @NotBlank @RequestParam String encryptedData,
            @NotBlank @RequestParam String iv) {
        try {
            ...
            return BaseResult.success(userInfo);
        } catch (WxErrorException e) {
            log.error("WxErrorException", e);
            return BaseResult.fail(e.getError().getErrorCode(), e.getError().getErrorMsg());
        }
    }

and app client code is

@FeignClient(name = "mini-program-api")
public interface MiniProgramApi {

    @RequestMapping(value = "/mini-program-api/user/userinfo", method = RequestMethod.POST, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    BaseResult<Map<String,Object>> userinfo2(@RequestHeader("hn-app-id") String hnAppId,
                                             @RequestParam("sessionKey") String sessionKey,
                                             @RequestParam("rawData") String rawData,
                                             @RequestParam("signature") String signature,
                                             @RequestParam("encryptedData") String encryptedData,
                                             @RequestParam("iv") String iv);

in spring-cloud-release F version
and i request sessionKey param is aaa+bbb
i check okhttp3 request log , sessionKey param has been change to aaa%2B%bbb
and app server accept sessionKey param is aaa+bbb

in spring-cloud-release G version
and i request sessionKey param is aaa+bbb
i check okhttp3 request log , sessionKey param has been change to aaa+bbb (no encode)
and app server accept sessionKey param is aaa bbb

how can i solve this problem?

thanks

Metadata

Metadata

Assignees

Labels

bugUnexpected or incorrect behaviorregressionBugs and issues related to unintended breaking changesspring-cloudIssues related to Spring Cloud OpenFeign

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions