@Nullable
    private static RequestTarget slowForClient(String reqTarget,
                                               @Nullable SchemeAndAuthority schemeAndAuthority,
                                               int pathPos) {
        final Bytes fragment;
        final Bytes path;
        final Bytes query;
        // Find where a query string and a fragment starts.
        final int queryPos;
        final int fragmentPos;
        // Note: We don't start from `pathPos + 1` but from `pathPos` just in case path is empty.
        final int maybeQueryPos = reqTarget.indexOf('?', pathPos);
        final int maybeFragmentPos = reqTarget.indexOf('#', pathPos);
        if (maybeQueryPos >= 0) {
            // Found '?'.
            if (maybeFragmentPos >= 0) {
                // Found '#', too.
                fragmentPos = maybeFragmentPos;
                if (maybeQueryPos < maybeFragmentPos) {
                    // '#' appeared after '?', e.g. ?foo#bar
                    queryPos = maybeQueryPos;
                } else {
                    // '#' appeared before '?', e.g. #foo?bar.
                    // It means the '?' we found is not a part of query string.
                    queryPos = -1;
                }
            } else {
                // No '#' in reqTarget.
                queryPos = maybeQueryPos;
                fragmentPos = -1;
            }
        } else {
            // No '?'.
            queryPos = -1;
            fragmentPos = maybeFragmentPos;
        }

        // Split into path, query and fragment.
        if (queryPos >= 0) {
            if ((path = decodePercentsAndEncodeToUtf8(
                    reqTarget, pathPos, queryPos,
                    ComponentType.CLIENT_PATH, SLASH_BYTES, true)) == null) {
                return null;
            }

            if (fragmentPos >= 0) {
                // path?query#fragment
                if ((query = decodePercentsAndEncodeToUtf8(
                        reqTarget, queryPos + 1, fragmentPos,
                        ComponentType.QUERY, EMPTY_BYTES, true)) == null) {
                    return null;
                }
                if ((fragment = decodePercentsAndEncodeToUtf8(
                        reqTarget, fragmentPos + 1, reqTarget.length(),
                        ComponentType.FRAGMENT, EMPTY_BYTES, true)) == null) {
                    return null;
                }
            } else {
                // path?query
                if ((query = decodePercentsAndEncodeToUtf8(
                        reqTarget, queryPos + 1, reqTarget.length(),
                        ComponentType.QUERY, EMPTY_BYTES, true)) == null) {
                    return null;
                }
                fragment = null;
            }
        } else {
            if (fragmentPos >= 0) {
                // path#fragment
                if ((path = decodePercentsAndEncodeToUtf8(
                        reqTarget, pathPos, fragmentPos,
                        ComponentType.CLIENT_PATH, EMPTY_BYTES, true)) == null) {
                    return null;
                }
                query = null;
                if ((fragment = decodePercentsAndEncodeToUtf8(
                        reqTarget, fragmentPos + 1, reqTarget.length(),
                        ComponentType.FRAGMENT, EMPTY_BYTES, true)) == null) {
                    return null;
                }
            } else {
                // path
                if ((path = decodePercentsAndEncodeToUtf8(
                        reqTarget, pathPos, reqTarget.length(),
                        ComponentType.CLIENT_PATH, EMPTY_BYTES, true)) == null) {
                    return null;
                }
                query = null;
                fragment = null;
            }
        }

        // Accept an asterisk (e.g. OPTIONS * HTTP/1.1).
        if (query == null && path.length == 1 && path.data[0] == '*') {
            return CLIENT_INSTANCE_ASTERISK;
        }

        final String encodedPath;
        if (isRelativePath(path)) {
            // Turn a relative path into an absolute one.
            encodedPath = '/' + encodePathToPercents(path);
        } else {
            encodedPath = encodePathToPercents(path);
        }

        final String encodedQuery = encodeQueryToPercents(query);
        final String encodedFragment = encodeFragmentToPercents(fragment);

        if (schemeAndAuthority != null) {
            return newAbsoluteTarget(schemeAndAuthority, encodedPath, encodedQuery, encodedFragment);
        } else {
            return new DefaultRequestTarget(RequestTargetForm.ORIGIN,
                                            null,
                                            null,
                                            null,
                                            -1,
                                            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