@Test
    void testRequestNoBodyWithoutExtraHeaders() throws Exception {
        testSocketOutput(
                "/foo",
                port -> "GET /foo HTTP/1.1\r\n" +
                        "host: 127.0.0.1:" + port + "\r\n" +
                        "user-agent: " + UserAgentUtil.USER_AGENT + "\r\n\r\n");
    }
", (ctx, req) -> {
                // The client was able to send a request with an escaped path param. Armeria servers always
                // decode the path so ctx.path == '/oneparam/foo%3Fbar' here.
                if ("/oneparam/foo%3Fbar".equals(req.headers().path()) &&
                    "/oneparam/foo%3Fbar".equals(ctx.path())) {
                    return HttpResponse.of("routed");
                }
                return HttpResponse.of(HttpStatus.INTERNAL_SERVER_ERROR);
            });

            sb.service("/escaping/{name}", (ctx, req) -> {
                if (Objects.equals(req.path(), ctx.path()) && "/escaping/foo%20bar".equals(req.path())) {
                    return HttpResponse.of(ctx.pathParam("name"));
                }
                return HttpResponse.of(HttpStatus.INTERNAL_SERVER_ERROR);
            });

            // To check https://github.com/line/armeria/issues/1895
            sb.serviceUnder("/", (ctx, req) -> {
                if (completed) {
                    return HttpResponse.of(HttpStatus.INTERNAL_SERVER_ERROR);
                } else {
                    completed = true;
                    return HttpResponse.of(HttpStatus.OK);
                }
            });

            sb.service("/client-aborted", (ctx, req) -> {
                // Don't need to return a real response since the client will timeout.
                completed = true;
                return HttpResponse.streaming();
            });

            sb.http(0);
            sb.https(0);
            sb.tlsSelfSigned();
            sb.disableServerHeader();
            sb.disableDateHeader();
        }
    };

    private static final ClientFactory clientFactory = ClientFactory.ofDefault();

    @BeforeEach
    void clearError() {
        completed = false;
        releasedByteBuf.set(null);
    }

    /**
When the content of a request is empty, the encoded request should never have 'content-length' or
'transfer-encoding' header.
core/src/test/java/com/linecorp/armeria/client/HttpClientIntegrationTest.java