Skip to content

Commit

Permalink
Merge pull request #87 from NHSDigital/NPA-2806_Fix_Mime_Response_Type
Browse files Browse the repository at this point in the history
NPA-2806 Fix Mime Type Response
  • Loading branch information
chris-young-12-nhs authored May 22, 2024
2 parents ab15414 + 13ac64f commit e566203
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This policy updates Application Operation Outcome response to include the correct headers.
Raisefault policies stop the execution of the current flow and move to the error flow, which returns the error response defined here to the requesting application.
For more information on RaiseFault policies within Apigee see the following resource:
* https://docs.apigee.com/api-platform/reference/policies/raise-fault-policy
-->
<RaiseFault async="false" continueOnError="false" enabled="true" name="RaiseFault.ApplicationOperationOutcome">
<DisplayName>RaiseFault.ApplicationOperationOutcome</DisplayName>
<Properties/>
<FaultResponse>
<Set>
<Headers>
<Header name="Content-Type">application/fhir+json</Header>
</Headers>
</Set>
</FaultResponse>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</RaiseFault>
7 changes: 6 additions & 1 deletion proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
</Step>
<Step>
<Name>SetRequestAWSMimeType</Name>
<Condition>(request.verb = "GET") or ((request.verb = "POST") and (request.header.Content-Type = "application/fhir+json"))</Condition>
</Step>
</Request>
</PreFlow>
Expand All @@ -47,6 +46,12 @@
</Step>
<Condition>response.header.x-amzn-ErrorType = "IncompleteSignatureException"</Condition>
</FaultRule>
<FaultRule name="ApplicationOperationOutcome">
<Step>
<Name>RaiseFault.ApplicationOperationOutcome</Name>
<Condition>response.header.x-amzn-RequestId != null</Condition>
</Step>
</FaultRule>
</FaultRules>
<HTTPTargetConnection>
<LoadBalancer>
Expand Down

0 comments on commit e566203

Please sign in to comment.