Files
klz-cables.com/.pnpm-store/v10/files/e6/261d1416a0dc8e4edd80b69132436ac42fea4c35c6d85785797af3863d73adc7da900123d433e5369067a823cb30f8e685ce57bf8311fd56b12da767019dec
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

27 lines
956 B
Plaintext

// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-obscure-range
const ACCEPTABLE_CONTENT_TYPE = /multipart\/['"()+-_]+(?:; ?['"()+-_]*)+$/i;
const UNACCEPTABLE_METHODS = new Set([
'CONNECT',
'DELETE',
'GET',
'HEAD',
'OPTIONS',
'TRACE'
]);
const hasBody = (req)=>{
return Boolean(req.headers.get('transfer-encoding') || req.headers.get('content-length') && req.headers.get('content-length') !== '0');
};
const hasAcceptableMethod = (req)=>!UNACCEPTABLE_METHODS.has(req.method);
const hasAcceptableContentType = (req)=>{
const contType = req.headers.get('content-type');
return contType.includes('boundary=') && ACCEPTABLE_CONTENT_TYPE.test(contType);
};
export const isEligibleRequest = (req)=>{
try {
return hasBody(req) && hasAcceptableMethod(req) && hasAcceptableContentType(req);
} catch (ignore) {
return false;
}
};
//# sourceMappingURL=isEligibleRequest.js.map