-
Notifications
You must be signed in to change notification settings - Fork 595
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
add setting ignore-illegal-header-for #687 #1942
add setting ignore-illegal-header-for #687 #1942
Conversation
Thank you for your pull request! After a quick sanity check one of the team will reply with 'OK TO TEST' to kick off our automated validation on Jenkins. This compiles the project, runs the tests, and checks for things like binary compatibility and source code formatting. When two team members have also manually reviewed and (perhaps after asking for some amendments) accepted your contribution, it should be good to be merged. For more details about our contributing process, check out CONTRIBUTING.md - and feel free to ask! |
OK TO TEST |
Another PR from the hackathon, please review @raboof @johanandren ? :) |
Test FAILed. |
Thanks for your contribution @shnmorimoto, this is indeed something people run into a lot, and it would be great if we could give them more fine-grained tools to suppress such warnings. You might have noticed the builds failed, this is because of our automated binary incompatibility checks:
The warnings on The warnings on Would you be up for fixing those? |
@raboof Thank you for your review. I understood about the reason for the builds failed. I will check the reference code and I will fix it. |
Test PASSed. |
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.
Starting to look good, added a couple of additional comments!
@@ -86,3 +86,5 @@ ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.javadsl.TimeoutA | |||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.scaladsl.TimeoutAccess.timeout") | |||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.scaladsl.TimeoutAccess.getTimeout") | |||
|
|||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.javadsl.settings.ParserSettings.getIgnoreIllegalHeaderFor") | |||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.scaladsl.settings.ParserSettings.ignoreIllegalHeaderFor") |
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.
Shouldn't we introduce a 10.1.0.backwards.excludes
?
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.
move configuration to 10.1.0.backwards.excludes.
@@ -386,6 +386,9 @@ akka.http { | |||
# `error-logging-verbosity`. | |||
illegal-header-warnings = on | |||
|
|||
# TODO comment |
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.
Describe the setting here
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.
add comment.
def withSummary(newSummary: String) = copy(summary = newSummary) | ||
def withSummaryPrepended(prefix: String) = withSummary(if (summary.isEmpty) prefix else prefix + ": " + summary) | ||
def withHeaderNamePrepend(headerName: String) = setErrorHeaderName(errorHeaderName = headerName) |
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 doesn't actually prepend the header name, right?
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.
Surely you are right. rename method.
new ErrorInfo(summary, detail, errorHeaderName) | ||
} | ||
|
||
private[akka] def setErrorHeaderName(errorHeaderName: String): ErrorInfo = new ErrorInfo(summary, detail, errorHeaderName) |
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.
Perhaps make this public and call it withErrorHeaderName
?
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.
Surely you are right. delete this method and rename withHeaderNamePrepend
method to withErrorHeaderName
.
@@ -26,6 +54,10 @@ object ErrorInfo { | |||
* Used for example when catching exceptions generated by the header value parser, which doesn't provide | |||
* summary/details information but structures its exception messages accordingly. | |||
*/ | |||
private[akka] def apply(summary: String = "", detail: String = ""): ErrorInfo = new ErrorInfo(summary, detail, "") |
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.
You introduced these new methods between the existing scaladoc documentation and the method they document below - can you reorder that?
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.
I made a mistake. reorder methods. thanks.
I'd like to consult one point. When set 'user-agent' in settings, ignore warn. |
Test PASSed. |
As per the HTTP spec header names should be treated case insensitive :) good question |
Thanks! I will fix it. |
Test PASSed. |
Test PASSed. |
@ktoso I will be glad if you review at your convenience. |
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.
Looks good to me, thanks for contributing this feature!
Looking great now, thanks! Updated branch and can merge after validation |
Test PASSed. |
Thanks a lot and sorry this took such a long time to merge! :-) |
@ktoso @raboof @johanandren |
Ref #687