Skip to content

Commit

Permalink
test after
Browse files Browse the repository at this point in the history
  • Loading branch information
mheinzerling committed Oct 25, 2024
1 parent d8f3e0f commit 7a677ee
Show file tree
Hide file tree
Showing 2 changed files with 417 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,7 @@ private void initContainerRequest(
final HttpServletResponse servletResponse,
final ResponseWriter responseWriter) throws IOException {

try {
requestContext.setEntityStream(new InputStreamWrapper() {
@Override
protected InputStream getWrapped() {
try {
return servletRequest.getInputStream();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
});
} catch (UncheckedIOException e) {
throw e.getCause();
}
setEntityStream(requestContext, servletRequest);

requestContext.setRequestScopedInitializer(requestScopedInitializer.get(new RequestContextProvider() {
@Override
Expand All @@ -458,6 +445,23 @@ public HttpServletResponse getHttpServletResponse() {
filterFormParameters(servletRequest, requestContext);
}

static void setEntityStream(ContainerRequest requestContext, HttpServletRequest servletRequest) throws IOException {
try {
requestContext.setEntityStream(new InputStreamWrapper() {
@Override
protected InputStream getWrapped() {
try {
return servletRequest.getInputStream();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
});
} catch (UncheckedIOException e) {
throw e.getCause();
}
}

/**
* Get default {@link javax.ws.rs.core.SecurityContext} for given {@code request}.
*
Expand Down
Loading

0 comments on commit 7a677ee

Please sign in to comment.