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

CORS Error: Missing PATCH Method in Access-Control-Allow-Methods Header #10462

Open
michaelG42 opened this issue Jul 2, 2024 · 0 comments · May be fixed by #10463
Open

CORS Error: Missing PATCH Method in Access-Control-Allow-Methods Header #10462

michaelG42 opened this issue Jul 2, 2024 · 0 comments · May be fixed by #10463
Labels
Type: Bug Bugs within the core SuiteCRM codebase

Comments

@michaelG42
Copy link

Issue

When attempting to update records using the SuiteCRM V8 API, a CORS error occurs because the PATCH method is not included in the Access-Control-Allow-Methods header.

Steps to Reproduce

  1. Make a PATCH request from the browser to the SuiteCRM V8 API to update a record.
  2. Observe the CORS error.

Expected Behavior

The PATCH request should be allowed, and the record should be updated.

Actual Behavior

A CORS error is thrown, and the request is blocked.

File and Code

The issue is in the file: suitecrm/Api/Core/app.php on the following line:

header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE');


### Possible Fix

header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE, PATCH');


### Steps to Reproduce the Issue

```bash
1. Make a PATCH request from the browser to the SuiteCRM V8 API to update a record.
2. Observe the CORS error.

Context

No response

Version

7.14

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

php 8.2

Operating System and Version

macOS sonoma 14.2.1

@michaelG42 michaelG42 added the Type: Bug Bugs within the core SuiteCRM codebase label Jul 2, 2024
michaelG42 added a commit to michaelG42/SuiteCRM that referenced this issue Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant