Warning: The magic method SFML_Singleton::__wakeup() must have public visibility in /home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php on line 72

Warning: Cannot modify header information - headers already sent by (output started at /home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/public/wp-includes/feed-rss2-comments.php on line 8
Comments on: Responding to HTTP OPTIONS requests in CakePHP https://www.munderwood.ca/index.php/2017/02/28/responding-to-http-options-requests-in-cakephp/ Tracking the occasional random walk Thu, 22 Nov 2018 23:39:43 +0000 hourly 1 https://wordpress.org/?v=5.7.2 By: Jose https://www.munderwood.ca/index.php/2017/02/28/responding-to-http-options-requests-in-cakephp/#comment-1995 Thu, 22 Nov 2018 23:39:43 +0000 http://www.munderwood.ca/?p=168#comment-1995 Thanks for your idea! it helped me to implement jwt seamlessly

]]>
By: Gustavo Cardoso https://www.munderwood.ca/index.php/2017/02/28/responding-to-http-options-requests-in-cakephp/#comment-1989 Sat, 17 Nov 2018 07:18:04 +0000 http://www.munderwood.ca/?p=168#comment-1989 Thanks, a lot. I was almost giveup.

]]>
By: James McDonald https://www.munderwood.ca/index.php/2017/02/28/responding-to-http-options-requests-in-cakephp/#comment-1697 Fri, 05 Jan 2018 10:13:27 +0000 http://www.munderwood.ca/?p=168#comment-1697 Oh and I forgot at the top of src/Application.php

Near the top under the previous use statements you need to add

use App\Middleware\httpOptionsMiddleware;

]]>
By: James McDonald https://www.munderwood.ca/index.php/2017/02/28/responding-to-http-options-requests-in-cakephp/#comment-1696 Fri, 05 Jan 2018 10:12:07 +0000 http://www.munderwood.ca/?p=168#comment-1696 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))

]]>