Source:
<code>public void onCompletion(BlobInfo result, Exception exception) { long processingStartTime = System.currentTimeMillis(); ReadableStreamChannel response = null; try { long routerTime = processingStartTime - operationStartTime; adminBlobStorageService.adminMetrics.headTimeInMs.update(routerTime); restRequest.getMetricsTracker().addToTotalCpuTime(routerTime); String blobId = AdminBlobStorageService.getOperationOrBlobIdFromUri(restRequest); logger.trace("Callback received for HEAD of {}", blobId); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); if (exception == null && result != null) { logger.trace("Successful HEAD of {}", blobId); <START> setBlobPropertiesResponseHeaders(result); <END> Map<String, String> userMetadata = RestUtils.buildUserMetadata(result.getUserMetadata()); if (userMetadata == null) { restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, "application/octet-stream"); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, result.getUserMetadata().length); response = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(result.getUserMetadata())); } else { setUserMetadataHeaders(userMetadata, restResponseChannel); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); response = new ByteBufferReadableStreamChannel(AdminBlobStorageService.EMPTY_BUFFER); } } else if (exception == null) { exception = new IllegalStateException("Both response and exception are null for HeadCallback"); } } catch (Exception e) { adminBlobStorageService.adminMetrics.callbackProcessingError.inc(); if (exception != null) { logger.error("Error while processing callback", e); } else { exception = e; } } finally { long processingTime = System.currentTimeMillis() - processingStartTime; adminBlobStorageService.adminMetrics.headCallbackProcessingTimeInMs.update(processingTime); restRequest.getMetricsTracker().addToTotalCpuTime(processingTime); if (exception != null) { adminBlobStorageService.adminMetrics.operationError.inc(); } adminBlobStorageService.submitResponse(restRequest, restResponseChannel, response, exception); } }</code><technical_language>this is wrong. HEAD definition return body. remove user metadata code completely - HEAD returning blob properties anyway</technical_language>

Target:
public void onCompletion(BlobInfo result, Exception exception) { long processingStartTime = System.currentTimeMillis(); ReadableStreamChannel response = null; try { long routerTime = processingStartTime - operationStartTime; adminBlobStorageService.adminMetrics.headTimeInMs.update(routerTime); restRequest.getMetricsTracker().addToTotalCpuTime(routerTime); String blobId = AdminBlobStorageService.getOperationOrBlobIdFromUri(restRequest); logger.trace("Callback received for HEAD of {}", blobId); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); if (exception == null && result != null) { logger.trace("Successful HEAD of {}", blobId); setBlobPropertiesResponseHeaders(result); } else if (exception == null) { exception = new IllegalStateException("Both response and exception are null for HeadCallback"); } } catch (Exception e) { adminBlobStorageService.adminMetrics.callbackProcessingError.inc(); if (exception != null) { logger.error("Error while processing callback", e); } else { exception = e; } } finally { long processingTime = System.currentTimeMillis() - processingStartTime; adminBlobStorageService.adminMetrics.headCallbackProcessingTimeInMs.update(processingTime); restRequest.getMetricsTracker().addToTotalCpuTime(processingTime); if (exception != null) { adminBlobStorageService.adminMetrics.operationError.inc(); } adminBlobStorageService.submitResponse(restRequest, restResponseChannel, response, exception); } }