Skip to content

Commit

Permalink
Merge pull request #87 from magento-api/MAGETWO-31613-UpgradeZf1-1.12.10
Browse files Browse the repository at this point in the history
[API] : MAGETWO-31613: [GITHUB] Magento API fails in a CGI env (zf1 issue) #790 (ZF Upgrade)
  • Loading branch information
Eugene Tulika committed Feb 10, 2015
2 parents 9a7c0a4 + fb4cb78 commit f4d5dd3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
18 changes: 0 additions & 18 deletions app/code/Magento/Webapi/Controller/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,4 @@ public function getCookie($name = null, $default = null)
{
return $this->_cookieReader->getCookie($name, $default);
}

/**
* {@inheritdoc}
*
* Added CGI environment support.
*/
public function getHeader($header)
{
$headerValue = parent::getHeader($header);
if ($headerValue == false) {
/** Workaround for php-fpm environment */
$header = strtoupper(str_replace('-', '_', $header));
if (isset($_SERVER[$header]) && in_array($header, ['CONTENT_TYPE', 'CONTENT_LENGTH'])) {
$headerValue = $_SERVER[$header];
}
}
return $headerValue;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"zendframework/zend-serializer": "2.3.1",
"zendframework/zend-log": "2.3.1",
"zendframework/zend-http": "2.3.1",
"magento/zendframework1": "1.12.9-patch1",
"magento/zendframework1": "1.12.10",
"composer/composer": "1.0.0-alpha8",
"monolog/monolog": "1.11.0",
"tubalmartin/cssmin": "2.4.8-p4"
Expand Down
13 changes: 7 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f4d5dd3

Please sign in to comment.