Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.MediaType;
import org.springframework.http.client.AbstractClientHttpResponse;
import org.springframework.http.client.ClientHttpResponse;

/**
* Using by {@link SentinelRestTemplate} and {@link SentinelProtectInterceptor}.
*
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
*/
public class SentinelClientHttpResponse extends AbstractClientHttpResponse {
public class SentinelClientHttpResponse implements ClientHttpResponse {

private String blockResponse = "RestTemplate request block by sentinel";

Expand All @@ -48,6 +49,11 @@ public SentinelClientHttpResponse(String blockResponse) {
this.blockResponse = blockResponse;
}

@Override
public HttpStatusCode getStatusCode() throws IOException {
return HttpStatus.OK;
}

@Override
public int getRawStatusCode() throws IOException {
return HttpStatus.OK.value();
Expand Down