dromara / dromara/forest

重定向后URL的Query参数会重复增加

Open
#197 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

在gitee上看到了这个问题,现在依旧有这个问题好像
使用
```

com.dtflys.forest
forest-spring-boot-starter
1.5.36

```
测试代码
```
try{
ForestRequest forestRequest = Forest.get("http://hsw00.com/x2/?fromuid=2613");
String execute = forestRequest.executeAsString();
}catch (Exception e){
e.printStackTrace();
}
```
可以执行上面这段代码,
在浏览器里面,
首次访问http://hsw00.com/x2/?fromuid=2613会301
重定向到访问http://hsw00.com/x2/portal.php?fromuid=2613
```
2024-04-03 15:52:43.450 [Forest] Http Backend: okhttp3
2024-04-03 15:52:43.541 [Forest] Request (okhttp3):
GET http://hsw00.com/x2/?fromuid=2613 HTTP
Headers:
User-Agent: forest/1.5.36
2024-04-03 15:52:44.121 [Forest] Response: Status = 301, Time = 569ms
2024-04-03 15:52:44.124 [Forest] Request (okhttp3):
[Redirect]: From GET http://hsw00.com/x2/ -> 301
GET http://hsw00.com/portal.php?fromuid=2613?fromuid=2613 HTTP
Headers:
User-Agent: forest/1.5.36
2024-04-03 15:52:44.394 [Forest] Response: Status = 404, Time = 270ms

```
日志显示访问到了http://hsw00.com/portal.php?fromuid=2613?fromuid=2613
参数被重复了....

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Forest.get example using forest-spring-boot-starter 1.5.36 and inspect the redirect request shown in the logs. Done means the redirected URL retains fromuid=2613 exactly once and no longer produces the observed 404 from the duplicated query parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.