DIYgod/RSSHub · warning

Invalid parameter brief. Please check the doc https://docs.r

Error message

Invalid parameter brief. Please check the doc https://docs.rsshub.app/guide/parameters#shu-chu-jian-xun

What it means

Thrown by the parameter middleware when the `brief` query parameter is present but does not match the regex /[1-9]\d{2,}/. That regex requires a positive integer of at least three digits whose first digit is 1-9, i.e. brief must be >= 100. The value controls how many plain-text characters of each item description are kept.

Source

Thrown at lib/middleware/parameter.ts:418

                item.description = simplecc(item.description ?? item.title ?? item.link, ctx.req.query('opencc')!);
            }
        }

        // brief
        if (ctx.req.query('brief')) {
            const num = /[1-9]\d{2,}/;
            if (num.test(ctx.req.query('brief')!)) {
                const brief: number = Number.parseInt(ctx.req.query('brief')!);
                for (const item of data.item) {
                    if (!item.description) {
                        continue;
                    }

                    const text = sanitizeHtml(item.description, { allowedTags: [], allowedAttributes: {} });
                    item.description = text.length > brief ? `<p>${text.slice(0, brief)}…</p>` : `<p>${text}</p>`;
                }
            } else {
                throw new Error('Invalid parameter brief. Please check the doc https://docs.rsshub.app/guide/parameters#shu-chu-jian-xun');
            }
        }
        // some parameters are processed in `anti-hotlink.js`

        ctx.set('data', data);
    } else {
        // throw new Error('wrong path');
    }
};

export default middleware;

View on GitHub (pinned to bed535e087)

Solutions

  1. Pass `?brief=` with an integer >= 100 (e.g. ?brief=200).
  2. Omit the parameter entirely if you do not want descriptions truncated.
  3. If you genuinely need very short descriptions, note the floor is 100 by design.

Example fix

// before
https://rsshub.example.com/bbc?brief=50
// after
https://rsshub.example.com/bbc?brief=200
Defensive patterns

Strategy: validation

Validate before calling

const isBriefValid = (raw: string | null): raw is string =>
  !!raw && /^[1-9]\d{2,}$/.test(raw);
// usage
if (query.brief != null && !isBriefValid(query.brief)) {
  throw new Error('brief must be an integer >= 100');
}

Type guard

const isBriefValid = (v: unknown): v is string =>
  typeof v === 'string' && /^[1-9]\d{2,}$/.test(v);

Prevention

When it happens

Trigger: Request includes `?brief=N` where N is < 100, has a leading zero, is non-numeric, or is a 1-2 digit number.

Common situations: User assumes brief means 'show 50 chars'; passes `?brief=10`; passes a floating or padded value like '050' or '1e2'.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/b128e28fdc9b53d7. Report an issue: GitHub.