-
Notifications
You must be signed in to change notification settings - Fork 1.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
Issue #5171 Simplify GzipHandler user-agent handling #5196
Merged
gregw
merged 7 commits into
jetty-10.0.x
from
jetty-10.0.x-5171-simplify-user-agent-gzip-handling
Aug 26, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8c6ee05
Issue #5171 Simplify GzipHandler user-agent handling
gregw 977dc94
+ Full implementation of HttpFields ensure
gregw f39a3b2
+ fixed checkstyle
gregw 7daecff
+ fixed test for merged header
gregw 838f8ee
+ fixed javadoc
gregw 0a09fa1
Issue #5171 Simplify GzipHandler user-agent handling
gregw b8bac62
rename and testing after review
gregw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html | ||
|
||
[description] | ||
Enables the MSIE rewrite rule for MSIE 5 and 6 known bugs. | ||
|
||
[depend] | ||
rewrite | ||
|
||
[files] | ||
basehome:modules/rewrite/rewrite-msie.xml|etc/rewrite-msie.xml | ||
|
||
[xml] | ||
etc/rewrite-msie.xml |
10 changes: 10 additions & 0 deletions
10
jetty-rewrite/src/main/config/modules/rewrite/rewrite-msie.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd"> | ||
<Configure id="Rewrite" class="org.eclipse.jetty.rewrite.handler.RuleContainer"> | ||
<Call name="addRule"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.rewrite.handler.MsieRule"/> | ||
</Arg> | ||
</Call> | ||
</Configure> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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 don't understand this logic.
The first if says "if the given field is single-valued"; but then
computeEnsure()
is passed the field, and there is no need to have two differentcomputeEnsure()
, the second with the values extracted from the field that is passed as first parameter 🤔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.
The implementation of the single field and multiple field versions are a bit different. Single field can already exist or not. Multi valued might partially exist.
I could simplify a
ensureField
a little, but only at the expense of complicating thecomputeEnsure
methods.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.
Note that I now have 100% test coverage of
ensureField
and bothcomputeEnsure
.