Source:
public void handleOptions(RestRequest restRequest, RestResponseChannel restResponseChannel) { long processingStartTime = System.currentTimeMillis(); handlePrechecks(restRequest, restResponseChannel); RestRequestMetrics requestMetrics = restRequest.getSSLSession() != null ? frontendMetrics.optionsSSLMetrics : frontendMetrics.optionsMetrics; restRequest.getMetricsTracker().injectMetrics(requestMetrics); Exception exception = null; try { logger.trace("Handling OPTIONS request - {}", restRequest.getUri()); checkAvailable(); securityService.preProcessRequest(restRequest).get(); long preProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsPreProcessingTimeInMs.update(preProcessingEndTime - processingStartTime); securityService.processRequest(restRequest).get(); long securityRequestProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityRequestTimeInMs.update(securityRequestProcessingEndTime - preProcessingEndTime); restResponseChannel.setStatus(ResponseStatus.Ok); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_ALLOW_METHODS, frontendConfig.optionsAllowMethods); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_MAX_AGE, frontendConfig.optionsValiditySeconds); securityService.processResponse(restRequest, restResponseChannel, null).get(); long securityResponseProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityResponseTimeInMs.update( securityResponseProcessingEndTime - securityRequestProcessingEndTime); } catch (Exception e) { exception = extractExecutionExceptionCause(e); } submitResponse(restRequest, restResponseChannel, null, exception); }

Target:
public void handleOptions(RestRequest restRequest, RestResponseChannel restResponseChannel) { long processingStartTime = System.currentTimeMillis(); handlePrechecks(restRequest, restResponseChannel); RestRequestMetrics requestMetrics = restRequest.isSslUsed() ? frontendMetrics.optionsSSLMetrics : frontendMetrics.optionsMetrics; restRequest.getMetricsTracker().injectMetrics(requestMetrics); Exception exception = null; try { logger.trace("Handling OPTIONS request - {}", restRequest.getUri()); checkAvailable(); securityService.preProcessRequest(restRequest).get(); long preProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsPreProcessingTimeInMs.update(preProcessingEndTime - processingStartTime); securityService.processRequest(restRequest).get(); long securityRequestProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityRequestTimeInMs.update(securityRequestProcessingEndTime - preProcessingEndTime); restResponseChannel.setStatus(ResponseStatus.Ok); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_ALLOW_METHODS, frontendConfig.optionsAllowMethods); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_MAX_AGE, frontendConfig.optionsValiditySeconds); securityService.processResponse(restRequest, restResponseChannel, null).get(); long securityResponseProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityResponseTimeInMs.update( securityResponseProcessingEndTime - securityRequestProcessingEndTime); } catch (Exception e) { exception = extractExecutionExceptionCause(e); } submitResponse(restRequest, restResponseChannel, null, exception); }