Fix Scripture Index doubled/unparseable refs, Titus passage fetch 400, Ko-fi QR 404, auto-load study comments; stop probe URLs inflating Real Hits, real 404 status for unknown URLs; v2.43.1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09177f47ed
commit
6a5d525d6e
10 files changed
+59
-10
No files matched your search
@@ -476,6 +476,19 @@ export function normalizeHitPath(pathname) {
|
||||
return pathname
|
||||
}
|
||||
|
||||
// Top-level URL segments the SPA / static pages actually serve. Anything else is a probe or
|
||||
// scanner hit, which must not count as a real visit or add a new key to the per-path stats.
|
||||
const KNOWN_SITE_SEGMENTS = new Set([
|
||||
'start-here', 'study', 'finished', 'episodes', 'nuggets', 'resources', 'downloads', 'about', 'contact',
|
||||
'questions', 'newsletter', 'scripture', 'thanks', 'subscribe', 'certificate', 'host', 'admin', 'preview',
|
||||
'privacy', 'terms', 'salvation', 'qr',
|
||||
])
|
||||
|
||||
export function isKnownSitePath(pathname) {
|
||||
const first = String(pathname ?? '/').split('/')[1] ?? ''
|
||||
return first === '' || KNOWN_SITE_SEGMENTS.has(first)
|
||||
}
|
||||
|
||||
export function shouldCountHit(req) {
|
||||
if (req.method !== 'GET') return false
|
||||
if (req.path.startsWith('/api/')) return false
|
||||
|
||||
Reference in new issue
Block a user