Skip to content
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

Can't set maxFormContentSize #4373

Closed
aarrsseni opened this issue Nov 27, 2019 · 6 comments
Closed

Can't set maxFormContentSize #4373

aarrsseni opened this issue Nov 27, 2019 · 6 comments
Assignees
Labels
Stale For auto-closed stale issues and pull requests

Comments

@aarrsseni
Copy link

9.4.24.v20191120

openjdk11

macOS

User defined value of maxFormContentSize will be ignored.
org.eclipse.jetty.server.handler.ContextHandler set value of maxFormContentSize to default:
_maxFormContentSize = Integer.getInteger(MAX_FORM_CONTENT_SIZE_KEY, DEFAULT_MAX_FORM_CONTENT_SIZE)
In org.eclipse.jetty.server.Request if context is not equal to null, lookup for attributes won't be called.

 if (_context != null)
            {
                ContextHandler contextHandler = _context.getContextHandler();
                maxFormContentSize = contextHandler.getMaxFormContentSize();
                maxFormKeys = contextHandler.getMaxFormKeys();
            }
            else
            {
                maxFormContentSize = lookupServerAttribute(ContextHandler.MAX_FORM_CONTENT_SIZE_KEY, maxFormContentSize);
                maxFormKeys = lookupServerAttribute(ContextHandler.MAX_FORM_KEYS_KEY, maxFormKeys);
            }

And the user defined value will be ignored.

@sbordet
Copy link
Contributor

sbordet commented Nov 27, 2019

This is by design. You want to set the max form content size on a per-context basis - the lookup as a server attribute is just a rare fallback for those cases where there is no context (some non-typical Jetty embedded usage).

@joakime
Copy link
Contributor

joakime commented Nov 27, 2019

Duplicate of #4311

@joakime joakime marked this as a duplicate of #4311 Nov 27, 2019
@joakime joakime closed this as completed Nov 27, 2019
@joakime
Copy link
Contributor

joakime commented Nov 27, 2019

See #4311 (comment) for details on how to configure maxFormContentSize

@joakime joakime removed the Duplicate label Nov 27, 2019
@joakime
Copy link
Contributor

joakime commented Nov 27, 2019

Reopening.

The server configuration facility could still exist.
But, only in this fashion...

  1. Server attributes set at LifeCycle startup.
  2. When each ContextHandler is initialized for the first time it does the following to initialize it's configuration for form max sizes.
    a. If context values are set, use those.
    b. If server attributes are set, use those as default values.
    c. Use context handler default values.

@stale
Copy link

stale bot commented Dec 4, 2020

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale For auto-closed stale issues and pull requests label Dec 4, 2020
@stale
Copy link

stale bot commented Jan 11, 2021

This issue has been closed due to it having no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale For auto-closed stale issues and pull requests
Projects
None yet
Development

No branches or pull requests

3 participants