f3-factory / fatfree-core

Fat-Free Framework core library
GNU General Public License v3.0
206 stars 89 forks source link

base: Add CORS defaults that are not initialized #347

Closed jrchamp closed 2 years ago

jrchamp commented 2 years ago

The default configuration is already being used to fill in the gaps for applications. However, if you only want to override one or two of the CORS configuration subitems, the rest of the CORS defaults are not filled in (because an array element is already present). This is particularly problematic when the credentials subitem is not present, because it is assumed to exist: https://github.com/bcosca/fatfree-core/blob/4e46ebadecd2fe4aa0f05658858db51b7dccd06c/base.php#L1701

As a result, this also fixes either a PHP Notice or a Server 500 error depending on the system's configuration.