Welcome Guest, Not a member yet? Register   Sign In
HTML 303
#1

Hi, i am trying to integrate a payment system and i am required to write a callback page that returns HTML code 200.
this is the controller i wrote as an example

Code:
public function callback()
{
return 1;
}

Route: https::/example.com/public/index.php/[controller]/callback

but i am getting this in access.log:

1.1.1.1 - - [18/Feb/2023:01:52:36 -0800] "POST /public/index.php/[controller]/callback HTTP/1.1" 303 5361 "-" "-"

What am i doing wrong? how can I make the controller return a 200 status?

thanks
Reply
#2

UPDATE: I found out that the Filter CSRF was causing the redirect. Now i have to find how to exclude some routes form the filter CSRF.
Reply
#3

(This post was last modified: 02-19-2023, 02:43 PM by Mobostar.)

(02-19-2023, 01:01 PM)chaos Wrote: UPDATE: I found out that the Filter CSRF was causing the redirect. Now i have to find how to exclude some routes form the filter CSRF.

You can exclude some routes like this:
PHP Code:
    public $globals = [
        'before' => [
            'csrf' => ['except' => ['api/*''search']],
        ],
        'after' => [
            'toolbar',
        ],
    ]; 

In this example, CSRF will not work for all URIs that start with"api/" and "search" URI.
Reply
#4

See https://codeigniter4.github.io/CodeIgnit...ml#globals
Reply




Theme © iAndrew 2016 - Forum software by © MyBB