Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
6dd78c8a
Commit
6dd78c8a
authored
Jun 29, 2017
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持 remoteIp 定义远程 IP 地址省去解析过程
parent
7c7a077e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
Client.php
src/base/Client.php
+1
-1
No files found.
src/base/Client.php
View file @
6dd78c8a
...
@@ -150,7 +150,7 @@ class Client
...
@@ -150,7 +150,7 @@ class Client
if
(
$this
->
remoteIp
)
{
if
(
$this
->
remoteIp
)
{
$host
=
parse_url
(
$url
,
PHP_URL_HOST
);
$host
=
parse_url
(
$url
,
PHP_URL_HOST
);
$url
=
substr_replace
(
$url
,
$this
->
remoteIp
,
strpos
(
$url
,
$host
),
strlen
(
$host
));
$url
=
substr_replace
(
$url
,
$this
->
remoteIp
,
strpos
(
$url
,
$host
),
strlen
(
$host
));
//$url = preg_replace('/^(https?:\/\/)[
\w\-\.]+?(\/.*)/i', '${1}'.$this->remoteIp.'$2'
, $url, 1);
//$url = preg_replace('/^(https?:\/\/)[
^\/]+/i', '${1}'.$this->remoteIp
, $url, 1);
$headers
[]
=
"Host:
$host
"
;
$headers
[]
=
"Host:
$host
"
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment