@Override
  public void onCompletion(String result, Exception exception) {
    try {
      restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime());
      if (exception == null && result != null) {
        setResponseHeaders(result);
      } else if (exception != null && exception instanceof RouterException) {
        exception = new RestServiceException(exception,
            RestServiceErrorCode.getRestServiceErrorCode(((RouterException) exception).getErrorCode()));
      }
    } catch (Exception e) {
      exception = exception == null ? e : exception;
    } finally {
      mockRestRequestService.handleResponse(restRequest, restResponseChannel, null, exception);
    }
  }
If there was no exception, updates the header with the location of the object.
@param result The result of the request. This is the blob ID of the blob. This is non null if the request executed
              successfully.
@param exception The exception that was reported on execution of the request (if any).
ambry-api/src/test/java/com/github/ambry/rest/MockRestRequestService.java