private static DefaultRequestTarget newAbsoluteTarget(
            SchemeAndAuthority schemeAndAuthority, String encodedPath,
            @Nullable String encodedQuery, @Nullable String encodedFragment) {

        final String scheme = schemeAndAuthority.scheme();
        final String maybeAuthority = schemeAndAuthority.authority();
        final String maybeHost = schemeAndAuthority.host();
        final int maybePort = schemeAndAuthority.port();
        final String authority;
        final String host;
        final int port;
        if (maybeHost == null) {
            authority = maybeAuthority;
            host = maybeAuthority;
            port = -1;
        } else {
            host = maybeHost;

            // Specify the port number only when necessary, so that https://foo/ and https://foo:443/
            // are considered equal.
            if (maybePort >= 0) {
                final Scheme parsedScheme = Scheme.tryParse(scheme);
                if (parsedScheme == null || parsedScheme.sessionProtocol().defaultPort() != maybePort) {
                    authority = maybeAuthority;
                    port = maybePort;
                } else {
                    authority = maybeHost;
                    port = -1;
                }
            } else {
                authority = maybeHost;
                port = -1;
            }
        }

        return new DefaultRequestTarget(RequestTargetForm.ABSOLUTE,
                                        scheme,
                                        authority,
                                        host,
                                        port,
                                        encodedPath,
                                        encodedPath,
                                        null,
                                        encodedQuery,
                                        encodedFragment);
    }
Marks this {@link RequestTarget} as stored in {@link RequestTargetCache} so that it doesn't
try to store again.
core/src/main/java/com/linecorp/armeria/internal/common/DefaultRequestTarget.java