-
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 #11266 - allow context attributes to be used to configure max form (content size / keys) #11274
Issue #11266 - allow context attributes to be used to configure max form (content size / keys) #11274
Conversation
…orm (content size / keys) + Allows these common configurations to be set via `WEB-INF/web.xml` without the need for a `WEB-INF/jetty-web.xml` Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@@ -215,8 +216,8 @@ private enum ProtectedTargetType | |||
private String[] _vconnectors; // connector portion, matching _vhosts array | |||
private Logger _logger; | |||
private boolean _allowNullPathInfo; | |||
private int _maxFormKeys = Integer.getInteger(MAX_FORM_KEYS_KEY, DEFAULT_MAX_FORM_KEYS); | |||
private int _maxFormContentSize = Integer.getInteger(MAX_FORM_CONTENT_SIZE_KEY, DEFAULT_MAX_FORM_CONTENT_SIZE); | |||
private int _maxFormKeys = MAX_FORM_UNSET; |
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 change would prevent the use of System properties being used, which would be removal of long released behaviour. You could just add in support for the context attributes, or we could punt this in favour of a different solution for jetty-web.xml
.
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 support for these two System properties was just moved to the doStart() location, not removed.
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 see it now in doStart()
. However, I don't think we should be doing this development in jetty-10
, if we're doing it, it should be in jetty-12
.
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 was a possible solution for what was brought up in Issue #11274, which meant it should be done in Jetty 10 thru Jetty 12.
But the OP (@vmassol) made some good points (see #11266 (comment)) and has convinced me that the approach in this PR isn't a great solution.
I'm totally OK with this being only for Jetty 12.
Want me to recreate this for Jetty 12 only? or drop it as a concept?
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.
IMHO we should do it for 12, and also update the doco for it with the new context attributes.
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.
Will do, and I'll add unit tests!
@@ -215,8 +216,8 @@ private enum ProtectedTargetType | |||
private String[] _vconnectors; // connector portion, matching _vhosts array | |||
private Logger _logger; | |||
private boolean _allowNullPathInfo; | |||
private int _maxFormKeys = Integer.getInteger(MAX_FORM_KEYS_KEY, DEFAULT_MAX_FORM_KEYS); | |||
private int _maxFormContentSize = Integer.getInteger(MAX_FORM_CONTENT_SIZE_KEY, DEFAULT_MAX_FORM_CONTENT_SIZE); | |||
private int _maxFormKeys = MAX_FORM_UNSET; |
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 see it now in doStart()
. However, I don't think we should be doing this development in jetty-10
, if we're doing it, it should be in jetty-12
.
Closing, will be a feature introduced in Jetty 12 instead. |
@joakime Hello. Thanks again for working on this. Do you know if the feature has now been integrated in Jetty 12 or not yet? I checked the release notes but couldn't see it (but I could have missed it). For the context, we're still stuck with #11266 and any solution would work for us, even context attributes :) thx! |
@joakime gentle ping to know if this feature has been added in Jetty 12, see #11274 (comment) Thx! |
See replacement PR #11898 |
PROOF OF CONCEPT
This is likely incomplete and certainly not tested (yet).
WEB-INF/web.xml
without the need for aWEB-INF/jetty-web.xml
The configuration in the
WEB-INF/web.xml
would look like this ...