class Aws::WAFV2::Types::CustomResponse
A custom response to send to the client. You can define a custom response for rule actions and default web ACL actions that are set to BlockAction
.
For information about customizing web requests and responses, see
- Customizing web requests and responses in WAF][1
-
in the [WAF
Developer Guide].
[1]: docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html [2]: docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html
@note When making an API call, you may pass CustomResponse
data as a hash: { response_code: 1, # required custom_response_body_key: "EntityName", response_headers: [ { name: "CustomHTTPHeaderName", # required value: "CustomHTTPHeaderValue", # required }, ], }
@!attribute [rw] response_code
The HTTP status code to return to the client. For a list of status codes that you can use in your custom reqponses, see [Supported status codes for custom response][1] in the [WAF Developer Guide][2]. [1]: https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-response-status-codes.html [2]: https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html @return [Integer]
@!attribute [rw] custom_response_body_key
References the response body that you want WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the `CustomResponseBodies` setting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default action `BlockAction` setting, you reference the response body using this key. @return [String]
@!attribute [rw] response_headers
The HTTP headers to use in the response. Duplicate header names are not allowed. For information about the limits on count and size for custom request and response settings, see [WAF quotas][1] in the [WAF Developer Guide][2]. [1]: https://docs.aws.amazon.com/waf/latest/developerguide/limits.html [2]: https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html @return [Array<Types::CustomHTTPHeader>]
@see docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CustomResponse AWS API Documentation
Constants
- SENSITIVE