Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento API fails in a CGI env (zf1 issue) #790

Closed
nyov opened this issue Dec 9, 2014 · 6 comments
Closed

Magento API fails in a CGI env (zf1 issue) #790

nyov opened this issue Dec 9, 2014 · 6 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@nyov
Copy link

nyov commented Dec 9, 2014

curl -X POST "http://magento.local/index.php/rest/V1/integration/customer/token" -H "Content-Type:application/json" -d '{"username":"user@local", "password":"pass"}'
{"message":"Content-Type header is empty."}

When php is run as (Fast)CGI (issue seen using php-fpm), some HTTP headers can't be found.
Relevant code is in https://github.com/magento/magento2/blob/master/app/code/Magento/Webapi/Controller/Rest/Request.php#L149
The issue lies with ZF1 failing to find the Content-Type header when there is no Apache Env.

Filed a patch upstream, at zendframework/zf1#477

@ghost
Copy link

ghost commented Dec 10, 2014

We are currently looking into this issue and will keep you posted with the updates. Thanks for providing the zf patch!

@nyov
Copy link
Author

nyov commented Dec 18, 2014

Thanks for fixing! Will verify and close then.

@nyov
Copy link
Author

nyov commented Dec 18, 2014

Looking good and Working here.

Closing this. :stamp_of_approval:

@nyov nyov closed this as completed Dec 18, 2014
@nyov
Copy link
Author

nyov commented Jan 3, 2015

Reopening this for a potentially "more proper" fix now committed to ZF1, zendframework/zf1#484
This upstream change may or may not clash (I haven't properly looked) with the change done in Magento's codebase, if this zf1 update eventually gets pulled into magento's fork.

Just a heads up. Feel free to close, please.

@nyov nyov reopened this Jan 3, 2015
@anupdugar
Copy link
Contributor

Thanks @nyov for the updated fix . We have an internal issue to address this : MAGETWO-31613. We will keep you posted when the fix is applied.

@muasir muasir added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 23, 2015
anupdugar added a commit that referenced this issue Feb 13, 2015
- Upgraded zf1 from 1.12.9 to 1.12.10
- Removed patched fix from Zend_Controller_Request_Http::getHeader since zf 1.12.10 has the actual fix
magento-team pushed a commit that referenced this issue Feb 13, 2015
[API] : MAGETWO-31613: [GITHUB] Magento API fails in a CGI env (zf1 issue) #790 (ZF Upgrade)
@anupdugar
Copy link
Contributor

@nyov We have gone ahead and upgraded to zf 1.12.10 (instead of just taking in the patch) in 0.42.0-beta8.
https://github.corp.ebay.com/magento-folks/magento2ce/blob/M2-GitHub-Update-0.42.0-beta8/composer.json#L32
This should take care of the issue you reported. Closing it.
Thank you for your contribution!

magento-team added a commit to abeeskau/magento2-community-edition that referenced this issue Feb 20, 2015
* Various improvements:
    * Existing Builders were replaced with DataFactories in Customer and Tax modules
    * Refactored controller actions in the Checkout and CMS modules
    * Increased coverage with static tests for `.phtml` files
    * Moved Cookie related functionality from `Theme` and `Core` modules into a new `Cookie` module
    * Moved minfication configuration settings to the `View` library level
* UI improvements:
    * Restyled installation wizard
    * Prepared styles for Dashboard in the Backend area
* Framework improvements:
    * Added `setCustomAttribute` and `setCustomAttributes` methods to `ExtensibleDataInterface`
    * Added setter methods to data object interfaces
    * Replaced `Builders` with `Factories`
    * Added `DataObjectHelper.php` which contains the common set of methods of all builders
    * Refactored `__()` to return `Phrase` object
    * Allowed usage of `LocalizedException` on the framework's library level
    * Added expiration/lifetime management of frontend resources
    * Unified MTF configurations format for Framework, TestCase variations and TestCase scenario configurations
* Fixed bugs:
    * Fixed an issue with product reviews list paging
    * Fixed an issue where sold products were not displayed in Bestsellers
    * Fixed an issue with image rendering on the CMS page on Frontend when `webserver rewrites = no`
* GitHub requests:
    * [#790](magento/magento2#790) -- Magento API fails in a CGI env (zf1 issue)
    * [#909](magento/magento2#909) -- Manage Titles in popup window front-end issue
    * [#996](magento/magento2#996) -- Pager block should support url "fragment".
    * [#985](magento/magento2#985) -- Allow camelcase in vendorname for menus
    * [#1025](magento/magento2#1025) -- Wrong parameter for getting base url for 'media' path in "Image" form element.
mmansoor-magento pushed a commit that referenced this issue Feb 1, 2017
magento-engcom-team added a commit that referenced this issue Jul 30, 2019
…id in the quote address #790

 - Merge Pull Request magento/graphql-ce#790 from magento/graphql-ce:GraphQL-784-validate-lowercase-countryId
 - Merged commits:
   1. e4c0752
   2. 28c5a88
   3. e9b6334
   4. 9078004
   5. 0394956
   6. dd0e02b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

3 participants