private void autoFillSchemeAuthorityAndOrigin() {
        final String authority = authority();
        if (authority != null && endpoint != null && endpoint.isIpAddrOnly()) {
            // The connection will be established with the IP address but `host` set to the `Endpoint`
            // could be used for SNI. It would make users send HTTPS requests with CSLB or configure a reverse
            // proxy based on an authority.
            final String host = SchemeAndAuthority.of(null, authority).host();
            if (!NetUtil.isValidIpV4Address(host) && !NetUtil.isValidIpV6Address(host)) {
                endpoint = endpoint.withHost(host);
            }
        }

        final HttpHeadersBuilder headersBuilder = internalRequestHeaders.toBuilder();
        headersBuilder.set(HttpHeaderNames.SCHEME, getScheme(sessionProtocol()));
        if (endpoint != null) {
            final String endpointAuthority = endpoint.authority();
            headersBuilder.set(HttpHeaderNames.AUTHORITY, endpointAuthority);
            final String origin = origin();
            if (origin != null) {
                headersBuilder.set(HttpHeaderNames.ORIGIN, origin);
            } else if (options().autoFillOriginHeader()) {
                final String uriText = sessionProtocol().isTls() ? SessionProtocol.HTTPS.uriText()
                                                                 : SessionProtocol.HTTP.uriText();
                headersBuilder.set(HttpHeaderNames.ORIGIN, uriText + "://" + endpointAuthority);
            }
        }
        internalRequestHeaders = headersBuilder.build();
    }
Creates a new instance. Note that {@link #init()} method must be invoked to finish
the construction of this context.

@param sessionProtocol the {@link SessionProtocol} of the invocation
@param id the {@link RequestId} that contains the identifier of the current {@link Request}
          and {@link Response} pair.
@param req the {@link HttpRequest} associated with this context
@param rpcReq the {@link RpcRequest} associated with this context
@param requestStartTimeNanos {@link System#nanoTime()} value when the request started.
@param requestStartTimeMicros the number of microseconds since the epoch,
                              e.g. {@code System.currentTimeMillis() * 1000}.
core/src/main/java/com/linecorp/armeria/internal/client/DefaultClientRequestContext.java