Handle redundant slashes in ticker config
I.e. `https://api.example.com//ticker/target` becomes `https://api.example.com/ticker/target`
This commit is contained in:
parent
6ff468a152
commit
8a87239adb
@ -44,9 +44,13 @@ class Tools extends Base {
|
|||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
|
||||||
}
|
}
|
||||||
curl_setopt($ch, CURLOPT_URL, $url . $target);
|
|
||||||
|
$url = rtrim($url, '/');
|
||||||
|
$target = ltrim($target, '/');
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url . '/' . $target);
|
||||||
// curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user