Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
b78471aa
Commit
b78471aa
authored
Oct 08, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Callback Sender Update [Response Header]
parent
4f4fa178
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
connect_site.php
test/callbacks/connect_site.php
+24
-2
No files found.
test/callbacks/connect_site.php
View file @
b78471aa
...
...
@@ -39,6 +39,12 @@ class ConnectSite extends FrameworkTest {
*/
private
$connectRequestMethod
=
NO_STRING
;
/**
*
* @var boolean
*/
private
$showResponseHeaders
=
false
;
/**
*
* @var array
...
...
@@ -128,6 +134,10 @@ class ConnectSite extends FrameworkTest {
if
(
is_array
(
$this
->
payload
->
requestHeaders
))
$this
->
connectRequestHeader
=
$this
->
payload
->
requestHeaders
;
}
if
(
isset
(
$this
->
payload
->
responseHeaders
)){
$this
->
showResponseHeaders
=
$this
->
payload
->
responseHeaders
;
}
}
private
function
processRequest
(
&
$statusCode
=
NO_STRING
){
...
...
@@ -138,6 +148,7 @@ class ConnectSite extends FrameworkTest {
curl_setopt
(
$handle
,
CURLOPT_FOLLOWLOCATION
,
true
);
curl_setopt
(
$handle
,
CURLOPT_ENCODING
,
"utf8"
);
curl_setopt
(
$handle
,
CURLOPT_HTTP_VERSION
,
CURL_HTTP_VERSION_1_1
);
curl_setopt
(
$handle
,
CURLOPT_HEADER
,
$this
->
showResponseHeaders
);
if
(
$this
->
isLoopData
(
$this
->
connectRequestHeader
)){
curl_setopt
(
$handle
,
CURLOPT_HTTPHEADER
,
$this
->
connectRequestHeader
);
...
...
@@ -147,7 +158,18 @@ class ConnectSite extends FrameworkTest {
curl_setopt
(
$handle
,
CURLOPT_POSTFIELDS
,
$this
->
connectRequestParams
);
}
if
(
$this
->
showResponseHeaders
){
$output
=
curl_exec
(
$handle
);
$headerSize
=
curl_getinfo
(
$handle
,
CURLINFO_HEADER_SIZE
);
$responseHeaders
=
substr
(
$output
,
0
,
$headerSize
);
$responseBody
=
substr
(
$output
,
$headerSize
);
$output
=
"[Headers]
\n\n
{
$responseHeaders
}
[Body]
\n\n
{
$responseBody
}
"
;
}
else
$output
=
curl_exec
(
$handle
);
$statusCode
=
curl_getinfo
(
$handle
,
CURLINFO_HTTP_CODE
);
if
(
$err
=
curl_error
(
$handle
)){
...
...
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