Skip to content

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

@nyov

Description

@nyov
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions