Add getStatus() to response obj

Closes #22241
This commit is contained in:
Rishabh Dixit 2023-08-04 12:28:09 +05:30 committed by Alexander Schwartz
parent 4d9e23700c
commit d73298aab6
2 changed files with 9 additions and 0 deletions

View file

@ -23,6 +23,10 @@ package org.keycloak.http;
* <p>Instances of this class can be obtained from {@link org.keycloak.models.KeycloakContext#getHttpResponse}.
*/
public interface HttpResponse {
/**
* Gets a status code.
*/
int getStatus();
/**
* Sets a status code.

View file

@ -39,6 +39,11 @@ public class HttpResponseImpl implements HttpResponse, KeycloakTransaction {
session.getTransactionManager().enlistAfterCompletion(this);
}
@Override
public int getStatus() {
return delegate.getStatus();
}
@Override
public void setStatus(int statusCode) {
delegate.setStatus(statusCode);