Skip to content

Commit a6436a6

Browse files
committed
add auth to health check
1 parent 0777905 commit a6436a6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

js/fetch-api.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,18 @@ class BreastDensityAPI {
163163
const timeoutId = setTimeout(() => controller.abort(), 5000);
164164

165165
try {
166-
const headers = {
167-
'Accept': 'application/json',
168-
'Origin': this.origin,
169-
'X-Requested-With': 'XMLHttpRequest'
166+
const requestHeaders = {
167+
...this.defaultHeaders,
168+
// Remove Content-Type to let browser set it automatically for FormData
169+
// This prevents multipart/form-data boundary issues
170170
};
171+
delete requestHeaders['Content-Type'];
171172

172173
console.log('🌐 Testing with origin header:', this.origin);
173174

174175
const response = await fetch(`${this.baseUrl}/health`, {
175176
method: 'GET',
176-
headers: headers,
177+
headers: requestHeaders,
177178
signal: controller.signal,
178179
mode: 'cors',
179180
credentials: 'include',

0 commit comments

Comments
 (0)