private void checkUploadRequirements(BlobProperties blobProperties) throws RestServiceException {
      if (RestUtils.isChunkUpload(restRequest.getArgs())) {
        // ensure that the x-ambry-session header is present.
        RestUtils.getHeader(restRequest.getArgs(), RestUtils.Headers.SESSION, true);
        // validate that a max chunk size is set.
        RestUtils.getLongHeader(restRequest.getArgs(), RestUtils.Headers.MAX_UPLOAD_SIZE, true);
        // validate that the TTL for the chunk is set correctly.
        long chunkTtl = blobProperties.getTimeToLiveInSeconds();
        if (chunkTtl <= 0 || chunkTtl > frontendConfig.chunkUploadMaxChunkTtlSecs) {
          throw new RestServiceException("Invalid chunk upload TTL: " + chunkTtl, RestServiceErrorCode.InvalidArgs);
        }
      }
    }
Enforce any additional requirements for certain types of uploads like data chunk uploads.
@param blobProperties the {@link BlobProperties} parsed from the request.
@throws RestServiceException
ambry-frontend/src/main/java/com/github/ambry/frontend/PostBlobHandler.java