{"record":{"id":"8c4ff3eb790dc256","repo":"DIYgod/RSSHub","slug":"invalid-column-8c4ff3","errorCode":null,"errorMessage":"Invalid column","messagePattern":"Invalid column","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/caixin/category.ts","lineNumber":53,"sourceCode":"以金融板块为例的 category 列表：（其余 column 以类似方式寻找）\n\n| 监管       | 银行 | 证券基金 | 信托保险         | 投资       | 创新       | 市场   |\n| ---------- | ---- | -------- | ---------------- | ---------- | ---------- | ------ |\n| regulation | bank | stock    | insurance\\\\_trust | investment | innovation | market |\n\nCategory 列表：\n\n| 封面报道   | 开卷  | 社论      | 时事             | 编辑寄语     | 经济    | 金融    | 商业     | 环境与科技              | 民生    | 副刊   |\n| ---------- | ----- | --------- | ---------------- | ------------ | ------- | ------- | -------- | ----------------------- | ------- | ------ |\n| coverstory | first | editorial | current\\\\_affairs | editor\\\\_desk | economy | finance | business | environment\\\\_technology | cwcivil | column |`,\n};\n\nasync function handler(ctx) {\n    const category = ctx.req.param('category');\n    const column = ctx.req.param('column');\n    const url = `https://${column}.caixin.com/${category}`;\n    if (!isValidHost(column)) {\n        throw new InvalidParameterError('Invalid column');\n    }\n\n    const response = await got(url);\n\n    const $ = load(response.data);\n    const title = $('head title').text();\n    const entity = JSON.parse(\n        $('script')\n            .text()\n            .match(/var entity = (\\{.*?\\})/)![1]\n    );\n\n    const {\n        data: { datas: data },\n    } = await got('https://gateway.caixin.com/api/extapi/homeInterface.jsp', {\n        searchParams: {\n            subject: entity.id,\n            type: 0,","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/caixin/category.ts#L35-L71","documentation":"Thrown by the Caixin category route when the `column` path parameter fails `isValidHost()`. Column is interpolated into `https://${column}.caixin.com/${category}` as a subdomain, so it must be a valid DNS label. Correctly uses `InvalidParameterError`. Note: the URL string is built before the validation check, but the fetch happens after, so this is safe.","triggerScenarios":"Calling `/caixin/<column>/<category>` with a column containing invalid hostname characters, dots, slashes, or empty string. Valid columns from the docs table include coverstory, first, editorial, current_affairs, editor_desk, economy, finance, business, environment_technology, cwcivil, column.","commonSituations":"Confusing `column` and `category` order in the URL, or pasting a full URL as the column.","solutions":["Use a documented column slug exactly (e.g. `coverstory`, `economy`).","Keep column as a bare DNS-safe label; do not include protocol, dots, or paths.","If you maintain the route, consider validating `category` too — only `column` is checked today."],"exampleFix":"// before\n/caixin/https://economy.caixin.com/finance\n// after\n/caixin/economy/finance","handlingStrategy":"validation","validationCode":"import { isValidHost } from '@/utils/valid-host';\nconst VALID_COLUMNS = ['coverstory','first','editorial','current_affairs','editor_desk','economy','finance','business','environment_technology','cwcivil','column'];\nif (!isValidHost(column) || !VALID_COLUMNS.includes(column)) {\n    throw new Error(`Invalid column '${column}'`);\n}","typeGuard":"function isCaixinColumn(v: string): boolean {\n    return /^[a-z0-9_-]+$/.test(v);\n}","tryCatchPattern":null,"preventionTips":["Keep column as a bare DNS-safe label.","Maintainers: validate `category` too, not just `column`, for defence in depth.","Mind the parameter order: `/caixin/<column>/<category>`."],"tags":["validation","user-input","hostname-validation","subdomain"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}