{"record":{"id":"b128e28fdc9b53d7","repo":"DIYgod/RSSHub","slug":"invalid-parameter-brief-please-check-the-doc-http","errorCode":null,"errorMessage":"Invalid parameter brief. Please check the doc https://docs.rsshub.app/guide/parameters#shu-chu-jian-xun","messagePattern":"Invalid parameter brief\\. Please check the doc https://docs\\.rsshub\\.app/guide/parameters#shu-chu-jian-xun","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/middleware/parameter.ts","lineNumber":418,"sourceCode":"                item.description = simplecc(item.description ?? item.title ?? item.link, ctx.req.query('opencc')!);\n            }\n        }\n\n        // brief\n        if (ctx.req.query('brief')) {\n            const num = /[1-9]\\d{2,}/;\n            if (num.test(ctx.req.query('brief')!)) {\n                const brief: number = Number.parseInt(ctx.req.query('brief')!);\n                for (const item of data.item) {\n                    if (!item.description) {\n                        continue;\n                    }\n\n                    const text = sanitizeHtml(item.description, { allowedTags: [], allowedAttributes: {} });\n                    item.description = text.length > brief ? `<p>${text.slice(0, brief)}…</p>` : `<p>${text}</p>`;\n                }\n            } else {\n                throw new Error('Invalid parameter brief. Please check the doc https://docs.rsshub.app/guide/parameters#shu-chu-jian-xun');\n            }\n        }\n        // some parameters are processed in `anti-hotlink.js`\n\n        ctx.set('data', data);\n    } else {\n        // throw new Error('wrong path');\n    }\n};\n\nexport default middleware;\n","sourceCodeStart":400,"sourceCodeEnd":430,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/middleware/parameter.ts#L400-L430","documentation":"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.","triggerScenarios":"Request includes `?brief=N` where N is < 100, has a leading zero, is non-numeric, or is a 1-2 digit number.","commonSituations":"User assumes brief means 'show 50 chars'; passes `?brief=10`; passes a floating or padded value like '050' or '1e2'.","solutions":["Pass `?brief=` with an integer >= 100 (e.g. ?brief=200).","Omit the parameter entirely if you do not want descriptions truncated.","If you genuinely need very short descriptions, note the floor is 100 by design."],"exampleFix":"// before\nhttps://rsshub.example.com/bbc?brief=50\n// after\nhttps://rsshub.example.com/bbc?brief=200","handlingStrategy":"validation","validationCode":"const isBriefValid = (raw: string | null): raw is string =>\n  !!raw && /^[1-9]\\d{2,}$/.test(raw);\n// usage\nif (query.brief != null && !isBriefValid(query.brief)) {\n  throw new Error('brief must be an integer >= 100');\n}","typeGuard":"const isBriefValid = (v: unknown): v is string =>\n  typeof v === 'string' && /^[1-9]\\d{2,}$/.test(v);","tryCatchPattern":null,"preventionTips":["Remember the floor is 100, not 1.","Validate client-side before building the RSSHub URL.","Omit brief when full descriptions are wanted."],"tags":["validation","parameters","middleware"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}