File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 156156 $ router ->map ('GET ' , '/{page:(?:.|/)*} ' , HttpToHttpsController::class)->setScheme ('http ' );
157157}
158158
159+ /*/ To prevent "405 Method Not Allowed" from the Router we only map `/*` to
160+ * OPTIONS when OPTIONS are actually requested.
161+ /*/
162+ if ($ request ->getMethod () === 'OPTIONS ' ) {
163+ $ router ->map ('OPTIONS ' , '/{path:.*} ' , CorsController::class);
164+ }
165+
159166$ router ->map ('GET ' , '/ ' , HelloWorldController::class);
160167
161168// @FIXME: CORS handling, slash-adding (and possibly others?) should be added as middleware instead of "catchall" URLs map
171178
172179$ router ->map ('GET ' , '/login ' , AddSlashToPathController::class);
173180$ router ->map ('GET ' , '/profile ' , AddSlashToPathController::class);
174-
175- $ router ->map ('OPTIONS ' , '/{path:.*} ' , CorsController::class);
176181$ router ->map ('GET ' , '/.well-known/openid-configuration ' , OpenidController::class);
177182$ router ->map ('GET ' , '/jwks ' , JwksController::class);
178183$ router ->map ('GET ' , '/login/ ' , LoginPageController::class);
You can’t perform that action at this time.
0 commit comments