private void setGetBlobResponseHeaders(RestRequest restRequest, BlobInfo blobInfo, GetBlobOptions options,
      RestResponseChannel restResponseChannel) throws RestServiceException {
    BlobProperties blobProperties = blobInfo.getBlobProperties();
    restResponseChannel.setHeader(RestUtils.Headers.BLOB_SIZE, blobProperties.getBlobSize());
    restResponseChannel.setHeader(RestUtils.Headers.ACCEPT_RANGES, RestUtils.BYTE_RANGE_UNITS);
    long contentLength = blobProperties.getBlobSize();
    if (options.getRange() != null) {
      Pair<String, Long> rangeAndLength =
          RestUtils.buildContentRangeAndLength(options.getRange(), contentLength, options.resolveRangeOnEmptyBlob());
      restResponseChannel.setHeader(RestUtils.Headers.CONTENT_RANGE, rangeAndLength.getFirst());
      contentLength = rangeAndLength.getSecond();
      // Store the calculated range size in an internal key. This can be used later if needed.
      restRequest.setArg(CONTENT_RANGE_LENGTH, String.valueOf(contentLength));
    }
    if (contentLength < frontendConfig.chunkedGetResponseThresholdInBytes) {
      restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, contentLength);
    }
    if (blobProperties.getContentType() != null) {
      restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, blobProperties.getContentType());
      // Ensure browsers do not execute html with embedded exploits.
      if (blobProperties.getContentType().equals("text/html")) {
        restResponseChannel.setHeader("Content-Disposition", "attachment");
      }
    }
    if (blobProperties.getContentEncoding() != null) {
      restResponseChannel.setHeader(Headers.CONTENT_ENCODING, blobProperties.getContentEncoding());
    }
  }
Sets the required headers in the response.
@param restRequest         the {@link RestRequest} that was received.
@param blobInfo            the {@link BlobInfo} to refer to while setting headers.
@param options             the {@link GetBlobOptions} associated with the request.
@param restResponseChannel the {@link RestResponseChannel} to set headers on.
@throws RestServiceException if there was any problem setting the headers.
ambry-frontend/src/main/java/com/github/ambry/frontend/AmbrySecurityService.java