private Callback<Void> securityPostProcessRequestCallback() {
        return buildCallback(metrics.getAccountsSecurityPostProcessRequestMetrics, securityCheckResult -> {
          RequestPath requestPath = (RequestPath) restRequest.getArgs().get(REQUEST_PATH);
          // Build a dummy blob path to get the account and container name
          String dummyBlobPath = requestPath.getOperationOrBlobId(true) + "/dummy";
          NamedBlobPath namedBlobPath = NamedBlobPath.parse(dummyBlobPath, restRequest.getArgs());
          String accountName = namedBlobPath.getAccountName();
          String containerName = namedBlobPath.getContainerName();
          try {
            Container container = accountService.getContainerByName(accountName, containerName);
            if (container == null) {
              throw new RestServiceException(
                  String.format("Container %s in account %s not found", containerName, accountName),
                  RestServiceErrorCode.NotFound);
            }
          } catch (AccountServiceException e) {
            throw new RestServiceException(
                String.format("Failed to get container %s from account %s", containerName, accountName),
                RestServiceErrorCode.getRestServiceErrorCode(e.getErrorCode()));
          }
          finalCallback.onCompletion(null, null);
        }, restRequest.getUri(), LOGGER, finalCallback);
      }
Process the request and construct the response according to the
<a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html">HeadObject spec</a> and
<a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html">BucketObject spec</a>

@param restRequest the {@link RestRequest} that contains the request parameters and body.
@param restResponseChannel the {@link RestResponseChannel} where headers should be set.
@param callback the {@link Callback} to invoke when the response is ready (or if there is an exception).
@throws RestServiceException exception when the processing fails
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3HeadHandler.java