adding CORS package and configured it #432
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description:
Overview
This pull request addresses Cross-Origin Resource Sharing (CORS) configuration in the SpringSecurityCorsApplication class. The primary goal is to allow requests from specified origins, methods, and headers to enhance the security and accessibility of the Spring Security application.
Changes Made
I have added a CORS filter using the addCorsMappings method from WebMvcConfigurer. The configuration allows requests from "http://localhost:3000/," "http://localhost/," and all origins (*). It permits all HTTP methods and headers for increased flexibility during development.
Context
CORS configuration is crucial for handling requests from different origins, especially when dealing with frontend applications running on different domains. This setup is beneficial for development environments, enabling seamless communication between a Spring Security backend and a frontend application hosted on "http://localhost:3000/" or "http://localhost/."
Additional Notes
Please review the changes and feel free to provide feedback or suggestions for improvement. Thank you!