Revert changes for 5502.
This commit is contained in:
parent
fab00ca3a0
commit
ee4ecacbdb
|
@ -93,10 +93,6 @@ public enum Pointcut implements IPointcut {
|
|||
* <li>
|
||||
* ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request
|
||||
* </li>
|
||||
* <li>
|
||||
* ca.uhn.fhir.rest.client.api.ClientResponseContext - Contains an IHttpRequest, an IHttpResponse, and an IRestfulClient
|
||||
* and also allows the client to mutate the contained IHttpResponse
|
||||
* </li>
|
||||
* </ul>
|
||||
* </p>
|
||||
* Hook methods must return <code>void</code>.
|
||||
|
@ -105,8 +101,7 @@ public enum Pointcut implements IPointcut {
|
|||
void.class,
|
||||
"ca.uhn.fhir.rest.client.api.IHttpRequest",
|
||||
"ca.uhn.fhir.rest.client.api.IHttpResponse",
|
||||
"ca.uhn.fhir.rest.client.api.IRestfulClient",
|
||||
"ca.uhn.fhir.rest.client.api.ClientResponseContext"),
|
||||
"ca.uhn.fhir.rest.client.api.IRestfulClient"),
|
||||
|
||||
/**
|
||||
* <b>Server Hook:</b>
|
||||
|
|
|
@ -353,24 +353,13 @@ public abstract class BaseClient implements IRestfulClient {
|
|||
|
||||
response = httpRequest.execute();
|
||||
|
||||
final Class<? extends IBaseResource> returnType = (binding instanceof ResourceResponseHandler)
|
||||
? ((ResourceResponseHandler<? extends IBaseResource>) binding).getReturnType()
|
||||
: null;
|
||||
|
||||
final ClientResponseContext clientResponseContext =
|
||||
new ClientResponseContext(httpRequest, response, this, getFhirContext(), returnType);
|
||||
HookParams responseParams = new HookParams();
|
||||
responseParams.add(IHttpRequest.class, httpRequest);
|
||||
responseParams.add(IHttpResponse.class, response);
|
||||
responseParams.add(IRestfulClient.class, this);
|
||||
responseParams.add(ClientResponseContext.class, clientResponseContext);
|
||||
|
||||
getInterceptorService().callHooks(Pointcut.CLIENT_RESPONSE, responseParams);
|
||||
|
||||
// Replace the contents of the response with whatever the hook returned, or the same response as before if
|
||||
// it no-op'd
|
||||
response = clientResponseContext.getHttpResponse();
|
||||
|
||||
String mimeType;
|
||||
if (Constants.STATUS_HTTP_204_NO_CONTENT == response.getStatus()) {
|
||||
mimeType = null;
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
type: add
|
||||
issue: 5502
|
||||
jira: SMILE-7262
|
||||
title: "It is now possible to mutate an HTTP response from the CLIENT_RESPONSE Pointcut, and pass this mutated response
|
||||
to downstream processing."
|
Loading…
Reference in New Issue