alibaba / alibaba/acm-sdk-php

服务返回多个ip导致请求的地址错误

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.