Welcome Guest, Not a member yet? Register   Sign In
JavaScript Fetch returns an error when in development mode.
#3

(This post was last modified: 07-12-2024, 09:03 PM by Renta Ardhana.)

(07-12-2024, 10:53 AM)ozornick Wrote: Disable toolbar for API URLs   Big Grin
https://codeigniter4.github.io/userguide...a-few-uris
yes it works. I moved toolbar filter from required to globals. Then add exception on it.

Code:
public array $required = [
        'before' => [
            'forcehttps', // Force Global Secure Requests
            'pagecache',  // Web Page Caching
        ],
        'after' => [
            'pagecache',  // Web Page Caching
            'performance', // Performance Metrics
            // 'toolbar',    // Debug Toolbar <-- I comment out
        ],
    ];

then..
Code:
public array $globals = [
        'before' => [
            // 'honeypot',
            'csrf' => ['except' => 'api/*'],
            // 'invalidchars',
        ],
        'after' => [
            // 'honeypot',
            // 'secureheaders',
            'toolbar' => ['except' => 'api/*'], // <-- copy to here and add exception
        ],
    ];
Reply


Messages In This Thread
RE: JavaScript Fetch returns an error when in development mode. - by Renta Ardhana - 07-12-2024, 08:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB