Skip to content

Commit 86cb2b5

Browse files
committed
Added script, revised hooks.server.js
1 parent 3dee902 commit 86cb2b5

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

scripts/merge-master.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/sync-audit-netlify.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Syncing audit-netlify with master..."
5+
6+
git checkout audit-netlify
7+
git pull origin audit-netlify
8+
git fetch origin master
9+
10+
if ! git merge origin/master --no-edit; then
11+
echo "❌ Merge conflict detected. Opening VS Code..."
12+
code .
13+
echo "🛠 Resolve conflicts, stage changes, and run: git commit && git push"
14+
exit 1
15+
fi
16+
17+
git push origin audit-netlify
18+
echo "✅ audit-netlify is now up to date with master."

src/hooks.server.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ export async function handle({ event, resolve }) {
3131

3232
const isProbely = isProbelyScanner({ ua: userAgent, ip: remoteIp });
3333

34-
if (isProbely) {
35-
console.info('[Probely Bypass] Matched scanner request:', {
36-
ip: remoteIp,
37-
ua: userAgent,
38-
});
39-
}
4034
const response = await resolve(event);
4135

4236
const env = detectEnvironment(event.url.hostname);
4337
const { isAudit, isDebug, isTest, isProd } = env;
4438

39+
if (isAudit && isProbely) {
40+
console.info('[Audit Mode] Probely scanner detected:', {
41+
ip: remoteIp,
42+
ua: userAgent,
43+
});
44+
}
45+
4546
const reportUri =
4647
isProd && !isTest && !isAudit
4748
? 'https://csp.netwk.pro/.netlify/functions/csp-report'

0 commit comments

Comments
 (0)