{"record":{"id":"0db822d6854de64b","repo":"DIYgod/RSSHub","slug":"invalid-country","errorCode":null,"errorMessage":"Invalid country","messagePattern":"Invalid country","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/fashionnetwork/headline.js","lineNumber":8,"sourceCode":"const got = require('@/utils/got');\nconst cheerio = require('cheerio');\nconst { isValidHost } = require('@/utils/valid-host');\n\nmodule.exports = async (ctx) => {\n    const country = ctx.params.country || 'ww';\n    if (!isValidHost(country)) {\n        throw new Error('Invalid country');\n    }\n\n    const rootUrl = `https://${country}.fashionnetwork.com`;\n    const response = await got({\n        method: 'get',\n        url: rootUrl,\n    });\n\n    const $ = cheerio.load(response.data);\n\n    const list = $('.point-carousel__item')\n        .slice(5, 10)\n        .map((_, item) => {\n            item = $(item);\n            const a = item.find('.family-title a');\n\n            return {\n                title: a.text(),","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/fashionnetwork/headline.js#L1-L26","documentation":"Thrown by the fashionnetwork headline route when the `country` path parameter (default 'ww') fails isValidHost. The value is interpolated into `https://${country}.fashionnetwork.com`, so it must be a single safe DNS label.","triggerScenarios":"Request to /fashionnetwork/headline/:country with a country containing dots, slashes, protocol characters, or other invalid host characters.","commonSituations":"Typo; passing 'fr.fashionnetwork.com' instead of 'fr'; attempting traversal.","solutions":["Use a valid fashionnetwork country label (e.g. 'ww', 'fr', 'cn', 'us').","Omit the country segment to use the 'ww' default.","Avoid dots, slashes, and protocols in the value."],"exampleFix":"// before\n/fashionnetwork/headline/fr.fashionnetwork.com\n// after\n/fashionnetwork/headline/fr","handlingStrategy":"validation","validationCode":"import { isValidHost } from '@/utils/valid-host';\nconst country = params.country ?? 'ww';\nif (!isValidHost(country)) throw new Error('Invalid country');","typeGuard":"const isSafeCountry = (v: unknown): boolean =>\n  typeof v === 'string' && /^[a-z0-9-]+$/i.test(v) && !v.includes('.');","tryCatchPattern":null,"preventionTips":["Pass only single-label country codes.","Default to 'ww' when the segment is omitted."],"tags":["validation","routes","ssrf-guard"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}