liubao68 commented on issue #4268:
URL:
https://github.com/apache/servicecomb-java-chassis/issues/4268#issuecomment-2022246179
> > > > > > 参考 #2329
> > > > >
> > > > >
> > > > > ```
> > > > > @RequestMapping(path = {"/{path:.+}"}, produces =
MediaType.APPLICATION_JSON_VALUE)
> > > > > public ResponseEntity<byte[]> catchAll(@PathVariable String
path, HttpServletRequest request)
> > > > > throws IOException {
> > > > > System.out.println(path);
> > > > > }
> > > > > ```
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 这种修改方式已经尝试过,我在这里用过 .+ 和 .* ,问题在于没法匹配多级路径,只可以匹配一级路径,如 /hello可以匹配,
/hello/test无法匹配
> > > >
> > > >
> > > > 也没有改过什么,就突然可以用了
> > >
> > >
> > >
在配置文件里,servicecomb.rest.address的端口号与spring设置的端口号不同时,可以匹配/hello,无法匹配/hello/test,而端口号一致时可以匹配两者。不知道是什么原因
> >
> >
> >
https://servicecomb.apache.org/references/java-chassis/zh_CN/spring-boot/introduction.html
两个的差异可以参考这个说明。 估计vert.x容器还没支持到你说的场景,不过得验证下。
>
>
我验证了好几次,配置文件里server.port与servicecomb.rest.address的端口号不一致时,会导致单层请求成功,多层失败。虽然这两个端口一般是保持一致的,但我正好要测试一下不同端口的转发情况,所以遇到了这个问题。
server.port是8088,servicecomb.rest.address是 0.0.0.0:8087
端口号不同的情况,你使用的8088端口请求的还是8087端口请求的?我测试了 servlet 和 vertx 两种场景都是正常的。
参考[代码](https://github.com/apache/servicecomb-java-chassis/pull/4273)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]