CORS Error: Missing PATCH Method in Access-Control-Allow-Methods Header
michaelG42 opened this issue · comments
Michael Grinnell commented
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
- Make a PATCH request from the browser to the SuiteCRM V8 API to update a record.
- 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