Skip to content

Commit

Permalink
Add CORS headers to catchAll Error response
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslinnell committed Aug 21, 2023
1 parent ed24029 commit 3594661
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessage.Errors.CatchAllMessage">
<Set>
<Headers>
<Header name="Access-Control-Allow-Origin">{request.header.origin}</Header>
<Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept, content-type, nhsd-session-urid, x-correlation-id, x-request-id, nhsd-end-user-organisation-ods, nhsd-end-user-organisation</Header>
<Header name="Access-Control-Max-Age">3628800</Header>
<Header name="Access-Control-Allow-Methods">GET, PUT, POST, DELETE</Header>
</Headers>
<Payload contentType="application/json" variablePrefix="%" variableSuffix="#">
{
"resourceType": "OperationOutcome",
Expand Down
3 changes: 3 additions & 0 deletions proxies/sandbox/apiproxy/proxies/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
<TargetEndpoint>sandbox</TargetEndpoint>
</RouteRule>
<DefaultFaultRule>
<Step>
<Name>AssignMessage.AddCors</Name>
</Step>
<Step>
<Name>AssignMessage.Errors.CatchAllMessage</Name>
</Step>
Expand Down

0 comments on commit 3594661

Please sign in to comment.