Skip to content

Commit

Permalink
Add Javadoc to MockHttpServletResponse
Browse files Browse the repository at this point in the history
This commit adds Javadoc to the `getContentLength` method of
`MockHttpServletResponse` to reflect that it gets its value from the
HTTP response header.

Closes gh-31833
  • Loading branch information
bclozel committed Jan 3, 2024
1 parent 50069ef commit f846d94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ public void setContentLength(int contentLength) {
doAddHeaderValue(HttpHeaders.CONTENT_LENGTH, contentLength, true);
}

/**
* Get the length of the content body from the HTTP Content-Length header.
* @return the value of the Content-Length header
* @see #setContentLength(int)
*/
public int getContentLength() {
return (int) this.contentLength;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ public void setContentLength(int contentLength) {
doAddHeaderValue(HttpHeaders.CONTENT_LENGTH, contentLength, true);
}

/**
* Get the length of the content body from the HTTP Content-Length header.
* @return the value of the Content-Length header
* @see #setContentLength(int)
*/
public int getContentLength() {
return (int) this.contentLength;
}
Expand Down

0 comments on commit f846d94

Please sign in to comment.