Add rawStatusCode() to ServerResponse in both WebFlux and Servlet
Closes gh-22872
This commit is contained in:
@@ -264,6 +264,11 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
|
||||
return HttpStatus.valueOf(this.statusCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rawStatusCode() {
|
||||
return this.statusCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final HttpHeaders headers() {
|
||||
return this.headers;
|
||||
|
||||
@@ -57,9 +57,20 @@ public interface ServerResponse {
|
||||
|
||||
/**
|
||||
* Return the status code of this response.
|
||||
* @return the status as an HttpStatus enum value
|
||||
* @throws IllegalArgumentException in case of an unknown HTTP status code
|
||||
* @see HttpStatus#valueOf(int)
|
||||
*/
|
||||
HttpStatus statusCode();
|
||||
|
||||
/**
|
||||
* Return the (potentially non-standard) status code of this response.
|
||||
* @return the status as an integer
|
||||
* @see #statusCode()
|
||||
* @see HttpStatus#valueOf(int)
|
||||
*/
|
||||
int rawStatusCode();
|
||||
|
||||
/**
|
||||
* Return the headers of this response.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user