Welcome Guest, Not a member yet? Register   Sign In
SecurityException Status Codes
#3

(This post was last modified: 03-27-2024, 03:51 PM by kenjis.)

No, CI4 returns 403 response when a CSRF error happens.
See https://codeigniter4.github.io/CodeIgnit...-exception

PHP Code:
<?php

namespace App\Controllers;

use 
CodeIgniter\Security\Exceptions\SecurityException;

class 
Home extends BaseController
{
    public function index()
    {
        throw SecurityException::forDisallowedAction();
    }


Code:
$ curl -D - -s  -o /dev/null http://localhost:8080
HTTP/1.1 403 Forbidden
Host: localhost:8080
Date: Wed, 27 Mar 2024 22:48:17 GMT
Connection: close
X-Powered-By: PHP/7.4.33
Cache-Control: no-store, max-age=0, no-cache
Content-Type: application/json; charset=UTF-8
Reply


Messages In This Thread
SecurityException Status Codes - by donpwinston - 03-27-2024, 04:26 AM
RE: SecurityException Status Codes - by kenjis - 03-27-2024, 03:50 PM
RE: SecurityException Status Codes - by kenjis - 03-31-2024, 02:43 PM
RE: SecurityException Status Codes - by kenjis - 04-01-2024, 06:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB