-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
MINOR: Remove Deadcode in NioTransport CORS #34324
Changes from 1 commit
8351ba1
39618a5
7da0ca8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,11 +167,6 @@ private void setPreflightHeaders(final HttpResponse response) { | |
private boolean setOrigin(final HttpResponse response) { | ||
final String origin = request.headers().get(HttpHeaderNames.ORIGIN); | ||
if (!Strings.isNullOrEmpty(origin)) { | ||
if ("null".equals(origin) && config.isNullOriginAllowed()) { | ||
setAnyOrigin(response); | ||
return true; | ||
} | ||
|
||
if (config.isAnyOriginSupported()) { | ||
if (config.isCredentialsAllowed()) { | ||
echoRequestOrigin(response); | ||
|
@@ -201,10 +196,6 @@ private boolean validateOrigin() { | |
return true; | ||
} | ||
|
||
if ("null".equals(origin) && config.isNullOriginAllowed()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems needed? Or is this handled in a different way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danielmitterdorfer actually this is always There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears unused indeed and I think we don't want/need it but maybe @tbrooks8 or @jasontedor can chime in here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't find a single usage of |
||
return true; | ||
} | ||
|
||
// if the origin is the same as the host of the request, then allow | ||
if (isSameOrigin(origin, request.headers().get(HttpHeaderNames.HOST))) { | ||
return true; | ||
|
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.
This seems needed? Or is this handled in a different way?