Page MenuHomeIn-Portal Phabricator

INP-1819 - Allow retrieving response headers after making the cURL request
ClosedPublic

Authored by alex on Aug 5 2022, 6:42 AM.

Details

Test Plan
  • anywhere
    • apply patch from the D422
  • in IDE:
    • open /index.php file for editing
    • replace $application->Run(); line with the following code:
/** @var kCurlHelper $curl_helper */
$curl_helper = $application->recallObject('CurlHelper');

$curl_helper->Send('http://www.google.com', false);
echo '<pre>', print_r($curl_helper->getResponseHeaders(), true), '</pre>';
$curl_helper->CloseConnection();
    • save changes
  • in Web Browser:
    • open /index.php
    • confirm, that page output contains this text (some array elements can be different, but the Location: ... line should be the same; the [3] => ... line was modified, because Phabricator was thinking that it contains an error)
Array
(
    [0] => HTTP/1.1 302 Found
    [1] => Location: https://www.google.com/?gws_rd=ssl
    [2] => Cache-Control: private
    [3] => Content-Type: ...
    [4] => Date: Fri, 05 Aug 2022 11:41:34 GMT
    [5] => Server: gws
    [6] => Content-Length: 231
    [7] => X-XSS-Protection: 0
    [8] => X-Frame-Options: SAMEORIGIN
    [9] => Set-Cookie: AEC=AakniGPnzy9fNDmUjeXGLYwlt9k3NWL-v0Cik0kAz2sN2vpv59iUmUuZcsQ; expires=Wed, 01-Feb-2023 11:41:34 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
)

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex created this revision.Aug 5 2022, 6:42 AM
alex requested review of this revision.Aug 5 2022, 6:42 AM
alex edited the test plan for this revision. (Show Details)Aug 5 2022, 6:47 AM
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)
erik accepted this revision.Aug 9 2022, 5:52 AM
This revision is now accepted and ready to land.Aug 9 2022, 5:52 AM
This revision was landed with ongoing or failed builds.Nov 9 2022, 9:53 AM
This revision was automatically updated to reflect the committed changes.