2 Comments

  1. I had a problems with OPTIONS request when using fetch from within react using Chrome.

    This fix is a work of pure genius.

    To install:

    mkdir src/Middleware

    create a new file named src/Middleware/httpOptionsMiddleware.php and put the contents of the above into it

    Open src/Application.php and append the new hook for the middleware

    // Add routing middleware.
    ->add(new RoutingMiddleware($this))

    // add http options
    ->add( new HttpOptionsMiddleware($this))

Leave a Reply

Your email address will not be published. Required fields are marked *