v7.6.0
When the "namespace" of the endpoint/route contained a space, it did not work correctly since the route was evaluated with the characters encoded through the url, it is as if a
<?php
echo urlencode("Path 1");
?>
There was an error when integrating several "Origins" in the cors, and therefore it only worked by integrating a single element within the function which has the complex/full path/endpoint, that is, it worked if in any case it was used:
http://localhost:4200
No when:
http://localhost:4200/
or
localhost:4200
This was solved in a more complete way that will allow adding more origins, such as an origin without a specific port:
$api->cors()->setAllowedOrigins(
"localhost",
"yourdomain.com"
);
That is, it now accepts all localhost ports and protocols either:
http/https
or
(http/https)://localhost:(80/3001/5000/4200).
You can easily ignore this restriction by entering the full url, but you must take into account that the directory or namespace should not be integrated, that is:
$api->cors()->setAllowedOrigins(
"https://yourdomain.com"
);
In this way the client's request will not be taken into account if it comes from an http site, not https.