This reverts commit 3e715665a1
.
This commit is contained in:
parent
0170145d95
commit
a59f009b95
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
type: add
|
||||
issue: 6152
|
||||
title: "Added the option to do HTTP HEAD requests against /metadata. Thanks to Jens Villadsen (@jkiddo) for the contribution!"
|
|
@ -220,12 +220,11 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding
|
|||
}
|
||||
|
||||
if ("metadata".equals(theRequest.getOperation())) {
|
||||
if (theRequest.getRequestType() == RequestTypeEnum.GET
|
||||
|| theRequest.getRequestType() == RequestTypeEnum.HEAD) {
|
||||
if (theRequest.getRequestType() == RequestTypeEnum.GET) {
|
||||
return MethodMatchEnum.EXACT;
|
||||
}
|
||||
throw new MethodNotAllowedException(
|
||||
Msg.code(388) + "/metadata request must use HTTP GET or HTTP HEAD", RequestTypeEnum.GET);
|
||||
Msg.code(388) + "/metadata request must use HTTP GET", RequestTypeEnum.GET);
|
||||
}
|
||||
|
||||
return MethodMatchEnum.NONE;
|
||||
|
|
|
@ -3,7 +3,6 @@ package ca.uhn.fhir.rest.server.method;
|
|||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.annotation.Metadata;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.RequestTypeEnum;
|
||||
import ca.uhn.fhir.rest.api.server.IRestfulServer;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
||||
|
@ -19,7 +18,6 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
@ -108,18 +106,6 @@ public class ConformanceMethodBindingTest {
|
|||
verify(provider, times(2)).getServerConformance(any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void invokeServer_metadata() {
|
||||
|
||||
RequestDetails requestDetails = mySrd;
|
||||
when(requestDetails.getOperation()).thenReturn("metadata");
|
||||
when(requestDetails.getRequestType()).thenReturn(RequestTypeEnum.GET);
|
||||
assertEquals(conformanceMethodBinding.incomingServerRequestMatchesMethod(requestDetails), MethodMatchEnum.EXACT);
|
||||
when(requestDetails.getRequestType()).thenReturn(RequestTypeEnum.HEAD);
|
||||
assertEquals(conformanceMethodBinding.incomingServerRequestMatchesMethod(requestDetails), MethodMatchEnum.EXACT);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
static class TestResourceProvider {
|
||||
|
||||
|
|
Loading…
Reference in New Issue