Matrix parameters are not encoded correctly

未关闭
#395 14 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@OlgaMaciaszek 已经在做这个了。

开始于 2020年9月14日。

评估

这个 Issue 还没有评估数据。

描述

bug

(This leads on from https://github.com/spring-cloud/spring-cloud-openfeign/issues/334 - apologies but at the time I didn't have enough spare time to create a sample application, but I now have).

When I try to use matrix parameters and Hoxton.SR7, they are encoded incorrectly. For example, assuming I have the folloing Feign client interface:

@FeignClient(url = "http://localhost:8080", name="name")
public interface FeignDemo {
    @GetMapping(value = "/api/server{account}")
    void server(@MatrixVariable("account") String account);
}

when making requests the URL is resolved as http://localhost:8080/api/server%3Baccount%3Da rather than the expected http://localhost:8080/api/server;account=a`:

2020-08-17 17:01:45.519 ERROR 23616 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException$BadRequest: [400] during [GET] to [http://localhost:8080/api/server%3Baccount%3Da] [FeignDemo#server(String)]: [{"timestamp":"2020-08-17T16:01:45.484+00:00","status":400,"error":"Bad Request","message":"","path":"/api/server%3Baccount%3Da"}]] with root cause

feign.FeignException$BadRequest: [400] during [GET] to [http://localhost:8080/api/server%3Baccount%3Da] [FeignDemo#server(String)]: [{"timestamp":"2020-08-17T16:01:45.484+00:00","status":400,"error":"Bad Request","message":"","path":"/api/server%3Baccount%3Da"}]

I have written the sample project https://github.com/nickcodefresh/spring-cloud-openfeign-334 to demo this issue. If you start the application and hit http://localhost:8080/api/client you'll see the error.

主要语言
Java
星标
1.3k
派生
834
平均合并
3 天 6 小时
30 天内合并 PR
14

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

spring-cloud/spring-cloud-openfeign 的其他 Issue

查看 spring-cloud/spring-cloud-openfeign 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。