dromara / dromara/forest

Client中使用@Address进行地址传递,在拦截器中通过request.getUrl或者getURI会爆StringOutOfBoundsExcepion

Open
#223 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
241
PR merge metrics
No merged PRs in 30d

Description

CLient中的代码:
`
public interface HttpClient {
@PostRequest(url = "{1}",headers = {
"Content-Type: application/json"
})
@Address(host = "{0}")
ForestResponse post(String host,String url,@Body Object body, @Header Map headers);
}
`
在拦截器中

![Image](https://github.com/user-attachments/assets/bf6942a1-a288-43c1-bab3-7215f7173257)

其中,reqeust.getUrl()出现StringOutOfBoundsExcepion

>

**问题分析:**
问题再与ForestURL.class 的toURLString方法

![Image](https://github.com/user-attachments/assets/b4efa63d-3b60-4f78-b73e-ac56b9d461bf)
下面是堆栈数据

![Image](https://github.com/user-attachments/assets/a8c61301-8ab9-4b14-a5de-e284c600dbab)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.