zf-fr / zfr-cors

A Zend Framework 2 module that helps you to deal with Cross-Origin Resource Sharing (CORS)
MIT License
60 stars 39 forks source link

GET work but POST request not working #52

Closed ViniciusDornelasDEV closed 6 years ago

ViniciusDornelasDEV commented 6 years ago
<?php
return array(
    'zfr_cors' => array(
         'allowed_origins' => array('*'),
         'allowed_methods' => array('GET', 'POST', 'OPTIONS'),
          'allowed_headers' => array('Authorization'),
    ),
);
?>

Message: Cross-source blocked: Same-source policy prevents reading of the remote file at http: //meat.local/login. (Reason: CORS 'Access-Control-Allow-Origin' header is not present)

In firebug, Network tab, receive 200 response, but my zend 2 server not receive any param

Using AbstractActionController

Any suggestion?

ViniciusDornelasDEV commented 6 years ago

wordked, i was using $this->getRequest()->getPost();, now use: json_decode($this->getRequest()->getContent())