mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
api: Added ability to supports CORS for API (#7357)
* Update defaults.inc.php * api: Added ability to supports CORS for API * added acknowledge * Update Configuration.md
This commit is contained in:
@@ -603,3 +603,20 @@ $config['ipmi']['type'][] = "open";
|
||||
### Distributed poller settings
|
||||
|
||||
[Distributed Poller](../Extensions/Distributed-Poller.md)
|
||||
|
||||
## API Settings
|
||||
|
||||
### CORS Support
|
||||
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
|
||||
|
||||
CORS support for the API is disabled by default. Below you will find the standard options,
|
||||
all of which you can configure.
|
||||
|
||||
```php
|
||||
$config['api']['cors']['enabled'] = false;
|
||||
$config['api']['cors']['origin'] = '*';
|
||||
$config['api']['cors']['maxage'] = '86400';
|
||||
$config['api']['cors']['allowmethods'] = array('POST', 'GET', 'PUT', 'DELETE', 'PATCH');
|
||||
$config['api']['cors']['allowheaders'] = array('Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'X-Auth-Token');
|
||||
```
|
||||
|
Reference in New Issue
Block a user