Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.
This repository was archived by the owner on May 23, 2022. It is now read-only.

OPTION method seem not working propery with CakePHP 4.1.5  #30

@emanueledona

Description

@emanueledona

Hi,
sorry for boring you but i'm stuck in the problem to make work the plugin with Cakephp 4.1.5.

I try to expose the configuration.

I'm creating an Angular App that work on a domani http://localhost:4200; the REST API server (cakephp) is working at http://work.local/.../api/.

I'm sure the two apps are working because if i put in bootstrap.php the headers below all the calls works fine:
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
exit(0);
}

I try configuring the plugin and using it with the default configuration BUT still now works if the call has preflight OPTION request.

The error is :

Access to XMLHttpRequest at 'http://work.local/.../api/v1/cms-orders.json' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I'm confused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions