private static String slowConcatPaths(String prefix, String path) {
        if (prefix.charAt(prefix.length() - 1) == '/') {
            if (path.charAt(0) == '/') {
                // `prefix` ends with '/' and `path` starts with '/'.
                // Avoid double-slash by stripping the first slash of `path`.
                try (TemporaryThreadLocals tmp = TemporaryThreadLocals.acquire()) {
                    return tmp.stringBuilder()
                              .append(prefix)
                              .append(path, 1, path.length())
                              .toString();
                }
            }

            // `prefix` ends with '/' and `path` does not start with '/'.
            // Simple concatenation would suffice.
            return simpleConcat(prefix, path);
        }

        if (path.charAt(0) == '/' || path.charAt(0) == '?') {
            // `prefix` does not end with '/' and `path` starts with '/' or '?'
            // Simple concatenation would suffice.
            return simpleConcat(prefix, path);
        }

        // `prefix` does not end with '/' and `path` does not start with '/' or '?'.
        // Need to insert '/' in-between.
        try (TemporaryThreadLocals tmp = TemporaryThreadLocals.acquire()) {
            return tmp.stringBuilder()
                      .append(prefix)
                      .append('/')
                      .append(path)
                      .toString();
        }
    }
Concatenates the specified {@code prefix} and {@code path} into an absolute path.

@throws IllegalArgumentException if {@code prefix} is not an absolute path prefix
core/src/main/java/com/linecorp/armeria/internal/common/ArmeriaHttpUtil.java