Skip to content

Commit b05416a

Browse files
authored
fix: notify activity was called for internal endpoints (#7361)
1 parent 7ab8f6c commit b05416a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/proxy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,10 @@ const onRequest = async (
859859
}
860860

861861
const maybeNotifyActivity = () => {
862-
const isInternalRequest = req.url?.startsWith('/.ntlfy-dev/') && req.method !== 'HEAD'
863-
if (api && process.env.NETLIFY_DEV_SERVER_ID && (req.method === 'GET' || isInternalRequest)) {
862+
const skipInternalUrls = ['/.ntlfy-dev/up', '/.ntlfy-dev/health']
863+
const isInternalRequest = req.url?.startsWith('/.ntlfy-dev/')
864+
const trackRequest = isInternalRequest ? !skipInternalUrls.includes(req.url ?? '') : req.method === 'GET'
865+
if (api && process.env.NETLIFY_DEV_SERVER_ID && trackRequest) {
864866
notifyActivity(api, siteInfo.id, process.env.NETLIFY_DEV_SERVER_ID)
865867
}
866868
}

0 commit comments

Comments
 (0)