Skip to content

Commit 3a59470

Browse files
committed
Sanitize webhook URL to remove spaces and double slashes
1 parent 0c5adb8 commit 3a59470

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/pages/Onboarding.jsx

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

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

2829
const copyToClipboard = async () => {
2930
try {

0 commit comments

Comments
 (0)