-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCM6126: initial commit for 413 error
- Loading branch information
1 parent
fc8c508
commit 664febe
Showing
2 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<!-- | ||
This policy raises a 406 error response for a missing or invalid Accept header. | ||
Valid values are: | ||
* `*/*` | ||
* `application/json` | ||
* `application/vnd.api+json` | ||
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.413RequestTooLarge"> | ||
<DisplayName>RaiseFault.413RequestTooLarge</DisplayName> | ||
<Properties/> | ||
<FaultResponse> | ||
<Set> | ||
<Headers/> | ||
<StatusCode>413</StatusCode> | ||
<ReasonPhrase>Request message was larger than the service limit</ReasonPhrase> | ||
<Payload variablePrefix="@" variableSuffix="#"> | ||
{ | ||
"errors" : [ | ||
{ | ||
"id" : "@messageid#.0", | ||
"code" : "CM_TOO_LARGE", | ||
"links" : { | ||
"about" : "{{ ERROR_ABOUT_LINK }}" | ||
}, | ||
"status" : "413", | ||
"title" : "Request too large", | ||
"detail" : "Request message was larger than the service limit", | ||
"source" : { | ||
"header" : "Accept" | ||
} | ||
} | ||
] | ||
} | ||
</Payload> | ||
</Set> | ||
</FaultResponse> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</RaiseFault> |