How Spring Boot allows all domain names to be accessed across domains and can use credentials

when using @ CrossOrigin (origins= "*") , there is a response header Access-Control-Allow-Origin: * . At this time, the front end setting withCredential will report an error Failed to load http://localhost:8080/test: Response to preflight request doesn"t pass access control check: The value of the "Access-Control-Allow-Origin" header in the response must not be the wildcard" * "when the request"s credentials mode is" include". Can Origin "http://localhost:3000" is therefore not allowed access.
set response headers for all requested websites, such as localhost:3000 access Access-Control-Allow-Origin: localhost:3000 .

Mar.23,2021

is told that @ CrossOrigin tagging cannot be implemented and can be implemented by filtering Filter.
takes a look at the fact that Filter can be implemented, and mdn has a simple example.

Menu