Skip to content

Commit

Permalink
Issue #6973 - Setup Request/Response objects for success with RequestLog
Browse files Browse the repository at this point in the history
+ Updating comments

Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Nov 30, 2021
1 parent b934fed commit 5ff321a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ protected void onRequestLog()
if (committedResponse != null)
{
getResponse().setStatus(committedResponse.getStatus());
// TODO: Reset the headers code to what was committed
// TODO: Reset the response headers to what they were when committed
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public void testNormalGetRequest() throws Exception
}

/**
* Test an unread HTTP/1.1 POST (where the server doesn't read the POST, but the RequestLog attempts to read it instead).
* Test an unread HTTP/1.1 POST, it has valid body content, the dispatched Handler on the server doesn't read the POST body content.
* The RequestLog accidentally attempts to read the Request body content due to the use of Request.getParameterNames() API.
*/
@Test
public void testNormalPostFormRequest() throws Exception
Expand Down Expand Up @@ -223,7 +224,9 @@ public void testNormalPostFormRequest() throws Exception

/**
* Test a Bad HTTP/1.1 POST Request, it has body content, but also includes a Content-Length + Transfer-Encoding header.
* The server doesn't read the POST body, but the RequestLog attempts to read the request body.
* This results in a BadMessage internally, and the Handler is never called.
* The POST body content is never read by a Handler or the error handling code.
* The RequestLog accidentally attempts to read the Request body content due to the use of Request.getParameterNames() API.
*/
@Test
public void testBadPostFormRequest() throws Exception
Expand Down Expand Up @@ -306,7 +309,7 @@ public void testBadPostFormRequest() throws Exception
}

/**
* Test where the response is committed, then changes the status code and response headers.
* Test where the response is committed, then the dispatch changes the status code and response headers.
* The RequestLog should see the committed status code and committed headers, not the changed ones.
*/
@Disabled("Support for restoring Committed Response Headers coming in later PR")
Expand Down

0 comments on commit 5ff321a

Please sign in to comment.