static HttpResponse handleResult0(HttpCodeStatusMapper statusMapper,
                                      ServiceRequestContext ctx, Object result) throws Throwable {
        final HttpStatus status;
        final Object body;
        MediaType contentType = null;
        if (result instanceof WebEndpointResponse) {
            final WebEndpointResponse<?> webResult = (WebEndpointResponse<?>) result;
            status = HttpStatus.valueOf(webResult.getStatus());
            body = webResult.getBody();
            contentType = toMediaType(webResult.getContentType());
        } else {
            if (result instanceof Health) {
                status = HttpStatus.valueOf(statusMapper.getStatusCode(((Health) result).getStatus()));
            } else if (result instanceof HealthComponent) {
                final Status actuatorStatus = ((HealthComponent) result).getStatus();
                status = HttpStatus.valueOf(statusMapper.getStatusCode(actuatorStatus));
            } else {
                status = HttpStatus.OK;
            }
            body = result;
        }

        if (contentType == null) {
            contentType = firstNonNull(ctx.negotiatedResponseMediaType(), MediaType.JSON_UTF_8);
        }

        if (contentType.isJson()) {
            final ResponseHeaders headers = ResponseHeaders.builder(status)
                                                           .contentType(contentType)
                                                           .build();
            return HttpResponse.ofJson(headers, body);
        }

        if (body instanceof CharSequence) {
            return HttpResponse.of(status, contentType, (CharSequence) body);
        }

        if (body instanceof byte[]) {
            return HttpResponse.of(status, contentType, (byte[]) body);
        }

        if (body instanceof Resource) {
            final Resource resource = (Resource) body;
            final String filename = resource.getFilename();
            final HttpResponseWriter res = HttpResponse.streaming();
            final long length = resource.contentLength();
            final ResponseHeadersBuilder headers = ResponseHeaders.builder(status);
            headers.contentType(contentType);
            headers.contentLength(length);
            headers.setTimeMillis(HttpHeaderNames.LAST_MODIFIED, resource.lastModified());
            if (filename != null) {
                headers.set(HttpHeaderNames.CONTENT_DISPOSITION,
                            "attachment;filename=" + FILENAME_BAD_CHARS.matcher(filename).replaceAll("_"));
            }

            res.write(headers.build());

            boolean success = false;
            ReadableByteChannel in = null;
            try {
                in = resource.readableChannel();
                final ReadableByteChannel finalIn = in;
                ctx.blockingTaskExecutor().execute(() -> streamResource(ctx, res, finalIn, length));
                success = true;
                return res;
            } finally {
                if (!success && in != null) {
                    try {
                        in.close();
                    } catch (IOException e) {
                        logger.warn("{} Failed to close an actuator resource: {}", ctx, resource, e);
                    }
                }
            }
        }

        logger.warn("{} Cannot convert an actuator response: {}", ctx, body);
        return HttpResponse.of(status, contentType, body.toString());
    }
{@link HttpService} to handle a {@link WebOperation}. Mostly inspired by reactive implementation in
{@link AbstractWebFluxEndpointHandlerMapping}.
spring/boot3-actuator-autoconfigure/src/main/java/com/linecorp/armeria/spring/actuate/WebOperationService.java