D
D
daniel_wesson2020-07-30 19:21:33
CORS
daniel_wesson, 2020-07-30 19:21:33

How to enable CORS for subdomains in laravel?

From my.domain.loc I send a request to domain.loc and get an error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ... . I found the /config/cors.php file: 5f22f31bc1d3c644424464.png
How to set it up only for subdomains (possibly for some other domains) is not clear to me, I did not find anything on this file in the dock.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-07-31
@daniel_wesson

This file essentially repeats the issuance of cors headers , to allow only subdomains, you need to list allowed origins in allowed origins or regexps in allowed origins patterns, which will be used to check the permission of a cross-domain call

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question