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

Undertow throws exception when TUS tries to respond with 409 or some other error status #40

Open
OverDrone opened this issue Apr 6, 2021 · 1 comment

Comments

@OverDrone
Copy link

CoreDefaultResponseHeadersHandler always writes header Content-Length=0
If some error detected, like incorrect offset, TUS calls HttpServletResponse.sendError() with some message. In other words there is nonempty response with header Content-Length=0. Undertow throws exception, probably because it allocates output buffer based on Content-Length header.

How to fix:

Remove setting Content-Length=0 from CoreDefaultResponseHeadersHandler.
Or overwrite Content-Length header before calling HttpServletResponse.sendError()

@Lesrac
Copy link

Lesrac commented Oct 20, 2021

Is there a way to resolve this? As there is no way to return a content in case that we experience an error after upload (as we do some checks after the file upload finished). And if we simply remove the "Content-Length=0" that is set by default, we don't get any Content-Length at all anymore.

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

No branches or pull requests

2 participants