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

Customizable error page buffer size #11654

Open
wants to merge 1 commit into
base: jetty-12.0.x
Choose a base branch
from

Conversation

dkaukov
Copy link

@dkaukov dkaukov commented Apr 15, 2024

Ability to increase buffer size past 8k in the custom ErrorHandler

@joakime
Copy link
Contributor

joakime commented Apr 16, 2024

The HttpConfiguration is how you control the output buffer size.

What is the use case for this?

@dkaukov
Copy link
Author

dkaukov commented Apr 16, 2024

True, but

    bufferSize = Math.min(8192, bufferSize); // TODO ?

limiting it to the 8k. We need a way to increase the limit.

@joakime
Copy link
Contributor

joakime commented Apr 17, 2024

limiting it to the 8k. We need a way to increase the limit.

I understand that you want to increase the buffer size limit, but why?
What's the use case for a larger buffer size? (I ask, as there's probably several different ways to accomplish your use case without increasing this specific buffer size)

@dkaukov
Copy link
Author

dkaukov commented Apr 18, 2024

Hi, In the

@Override
protected void writeErrorHtml(Request request, Writer writer, Charset charset, int code, String message, Throwable cause, boolean showStacks) throws IOException {
  ....
}

we are generating custom error page using Writer. Something like:

  themeLeafTemplate.execute(writer, errorInfo);

If error page is bigger than buffer size it is just trimmed.

@joakime
Copy link
Contributor

joakime commented Apr 18, 2024

Need to dig into why we are doing this via a static sized buffer.

I would like to see if this need can be accomplished via a Writer created with the Content.Sink features instead. (will try this in a different branch soon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants