-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CORS throwing 500 upon encountering a malformed URL #33682 #33688
Fix CORS throwing 500 upon encountering a malformed URL #33682 #33688
Conversation
@@ -38,19 +39,22 @@ public abstract class CorsUtils { | |||
* Returns {@code true} if the request is a valid CORS one by checking {@code Origin} | |||
* header presence and ensuring that origins are different. | |||
*/ | |||
public static boolean isCorsRequest(HttpServletRequest request) { | |||
public static IsCorsRequestResult isCorsRequest(HttpServletRequest request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK to introduce a breaking public API change for this bugfix? If so, it's probably worth documenting in the release notes.
spring-web/src/main/java/org/springframework/web/cors/CorsUtils.java
Outdated
Show resolved
Hide resolved
spring-web/src/main/java/org/springframework/web/cors/DefaultCorsProcessor.java
Show resolved
Hide resolved
Thanks for the PR @IgorOffline, although I was already working on it (as indicated by the fact that I'm assigned the issue). Your solution is going a bit too far anyway. Note I have mistakenly referred the PR in my own version of the fix though 😅 See gh-33682 |
Thank you! |
Fix for 33682
Also remove BeforeEach in CrossOriginTests because many tests do not need the "setup" step.