Example allowing direct connections from any host with any headers
$cors= new class() implements Filter {
public function filter($request, $response, $invokation) {
$response->header('Access-Control-Allow-Origin', '*');
$response->header('Access-Control-Allow-Headers', '*');
if ('OPTIONS' === $request->method()) {
$response->answer(200);
return;
}
return $invokation->proceed($request, $response);
}
};
Should there be an implementation for this in web.filters?
Example allowing direct connections from any host with any headers
Should there be an implementation for this in
web.filters?