服务返回多个ip导致请求的地址错误
- Dominant language
- PHP
- Stars
- 36
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
服务返回多个ip是会导致拼接出来的地址中包含多个ip报 Resource id #9; cURL error: Illegal characters found in URL (3Array ( [url] => http://100.100.30.17 100.100.103.3:8080/diamond-server/config.co?
修复方案如下
文件名:Client.php
public function refreshServerList(){
$this->serverList = array();
$serverRawList = $this->getServerListStr();
if(is_string($serverRawList)){
$serverArray = explode("\n", $serverRawList);
$serverArray = array_filter($serverArray);
\n由单引号修改成双引号 并增加 array_filter($serverArray);
Contributor guide
No contributing guide indexed for this repository
Research direction
Open Client.php and start with refreshServerList(), then inspect getServerListStr() and the parsing shown in the issue. Verify the returned server list is filtered before it is used to build request URLs; done means a response containing multiple IPs no longer produces an illegal URL with concatenated addresses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100