private HttpException createIfNoneMatchException(String etag, String message) {
        HttpStatus statusCode;
        Map<String, String> headers;
        if ("GET".equalsIgnoreCase(method) || "HEAD".equalsIgnoreCase(method)) {
            statusCode = HttpStatus.NOT_MODIFIED;
            headers = Map.of("etag", etag);
        } else {
            statusCode = HttpStatus.PRECONDITION_FAILED;
            headers = Map.of();
        }
        return new HttpException(statusCode, message, headers);
    }
Http method, e.g. GET, PUT, POST and etc
storage/src/main/java/com/epam/aidial/core/storage/util/EtagHeader.java