Skip to content

Commit 026215f

Browse files
committed
Fix newline injection in webhook URL
1 parent 3a59470 commit 026215f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/api/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://127.0.0.1:5001';
1+
export const API_BASE_URL = (import.meta.env.VITE_API_URL || 'http://127.0.0.1:5001').trim();
22

33
// Strips markdown link formatting e.g. "[a@b.com](mailto:a@b.com)" → "a@b.com"
44
export function cleanEmail(raw) {

src/pages/Onboarding.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default function Onboarding() {
2323
medical_license: '', specialisation: ''
2424
});
2525

26-
const baseUrl = API_BASE_URL.trim().replace(/\/$/, "");
27-
const webhookUrl = `${baseUrl}/webhook/apple-health?user_email=${user?.email?.toLowerCase()}`.replace(/\s/g, '');
26+
const baseUrl = API_BASE_URL.replace(/\/$/, "").trim();
27+
const webhookUrl = (baseUrl + "/webhook/apple-health?user_email=" + (user?.email?.toLowerCase() || "")).replace(/\s/g, "");
2828

2929
const copyToClipboard = async () => {
3030
try {

0 commit comments

Comments
 (0)