At least one 200 or 202 response should be defined for HEAD operations

Description

HEAD operations in your API must have at least one 200 or 202 response defined.

For more details, see RFC 7231.

Example

The following is an example of how this type of risk could look in your API definition:

1head:
2  # ...
3  responses:
4    "404":
5      description: Not found
6      content:
7        application/json:
8          schema:
9            $ref: "#/components/responses/404"
10

Remediation

Define 200 or 202 responses for all HEAD operations.

1head:
2  # ...
3  responses:
4    "200":
5      description: OK
6    #...
7

Copyright 42Crunch 2021