Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
fix(server): normalize PUBLIC_APP_URL to origin in pulse emails (#641)
Patel Dhrit544f3f1b35a6
diff --git a/server/src/lib/pulse/engine.js b/server/src/lib/pulse/engine.jsindex ba3d0c904..98340e8dd 100644--- a/server/src/lib/pulse/engine.js+++ b/server/src/lib/pulse/engine.js@@ -20,8 +20,23 @@ import { renderPulseEmail, sendPulseEmail } from './email.js';const WEEKLY_SEND_UTC_DAY = 1; // Monday+let warnedAppUrlPath = false;+function appUrl() {- return (process.env.PUBLIC_APP_URL || 'http://localhost:3000').replace(/\/$/, '');+ const raw = process.env.PUBLIC_APP_URL || 'http://localhost:3000';+ try {+ const url = new URL(raw);+ if (url.pathname !== '/' && url.pathname !== '' && !warnedAppUrlPath) {+ warnedAppUrlPath = true;+ logger.warn(+ { PUBLIC_APP_URL: raw },+ '[pulse] PUBLIC_APP_URL includes a path; using the origin only. Set it to the bare origin (e.g. https://app.example.com) to silence this warning.',+ );+ }+ return url.origin;+ } catch {+ return raw.replace(/\/$/, '');+ }}/** Recipient emails: explicit list from settings, else every org member. */