Skip to content

Commit

Permalink
Merge pull request #778 from kaltura/Rigel-18.2.0-PLAT-23623
Browse files Browse the repository at this point in the history
PLAT-23623: Client should treat headers as case insensitive
  • Loading branch information
drorsou authored Mar 20, 2022
2 parents 6204174 + 9d8123a commit 4fc2167
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sources/cli/kalcli.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function printLogFiltered($logPortion, $sessionId)

$logPortion = file_get_contents(API_LOG_FILENAME, false, null, $initialLogSize, $currentLogSize - $initialLogSize);

if (preg_match('/X-Kaltura-Session: (\d+)/', $curlWrapper->responseHeaders, $matches))
if (preg_match('/x-kaltura-session: (\d+)/', strtolower($curlWrapper->responseHeaders), $matches))
{
$sessionId = $matches[1];
printLogFiltered($logPortion, $sessionId);
Expand Down
4 changes: 2 additions & 2 deletions sources/php5/KalturaClientBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ public function doQueue()
foreach ($this->responseHeaders as $curHeader)
{
$splittedHeader = explode(':', $curHeader, 2);
if ($splittedHeader[0] == 'X-Me')
if (strtolower($splittedHeader[0]) == 'x-me')
$serverName = trim($splittedHeader[1]);
else if ($splittedHeader[0] == 'X-Kaltura-Session')
else if (strtolower($splittedHeader[0]) == 'x-kaltura-session')
$serverSession = trim($splittedHeader[1]);
}
if (!is_null($serverName) || !is_null($serverSession))
Expand Down
4 changes: 2 additions & 2 deletions sources/php53/library/Kaltura/Client/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ public function doQueue()
foreach ($this->responseHeaders as $curHeader)
{
$splittedHeader = explode(':', $curHeader, 2);
if ($splittedHeader[0] == 'X-Me')
if (strtolower($splittedHeader[0]) == 'x-me')
$serverName = trim($splittedHeader[1]);
else if ($splittedHeader[0] == 'X-Kaltura-Session')
else if (strtolower($splittedHeader[0]) == 'x-kaltura-session')
$serverSession = trim($splittedHeader[1]);
}
if (!is_null($serverName) || !is_null($serverSession))
Expand Down
4 changes: 2 additions & 2 deletions sources/zend/Kaltura/Client/ClientBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ public function doQueue()
foreach ($this->responseHeaders as $curHeader)
{
$splittedHeader = explode(':', $curHeader, 2);
if ($splittedHeader[0] == 'X-Me')
if (strtolower($splittedHeader[0]) == 'x-me')
$serverName = trim($splittedHeader[1]);
else if ($splittedHeader[0] == 'X-Kaltura-Session')
else if (strtolower($splittedHeader[0]) == 'x-kaltura-session')
$serverSession = trim($splittedHeader[1]);
}
if (!is_null($serverName) || !is_null($serverSession))
Expand Down

0 comments on commit 4fc2167

Please sign in to comment.