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

Add JaxRsFeature.READ_FULL_STREAM to consume all content, on by default #170

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ protected EP_CONFIG _configForReading(MAPPER mapper,
} else {
r = mapper.reader();
}
if (JaxRSFeature.READ_FULL_STREAM.enabledIn(_jaxRSFeatures)) {
r = r.withFeatures(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);
}
return _configForReading(r, annotations);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public enum JaxRSFeature implements ConfigFeature
*/
ALLOW_EMPTY_INPUT(true),

/**
* For HTTP keep-alive or multipart content to work correctly, Jackson must read the entire HTTP input
* stream up until reading EOF (-1).
* <a href="https://github.com/FasterXML/jackson-jaxrs-providers/issues/108">Issue #108</a>
* If set to true, always consume all input content. This has a side-effect of failing on trailing content.
*/
READ_FULL_STREAM(true),

/*
/**********************************************************
/* HTTP headers
Expand Down