Mona commited on
Commit ·
4b88879
1
Parent(s): 5cdc985
mo: fix Authorization header case for Apache/PHP compatibility
Browse files- PHP $_SERVER['HTTP_AUTHORIZATION'] requires capital-A Authorization header
- Updated api.js and cloud.js to use proper header case
- All 14 tests passing, all API endpoints verified
- src/api.js +1 -1
- src/cloud.js +1 -1
src/api.js
CHANGED
|
@@ -17,7 +17,7 @@ const P = CLOUD.paths; // platform-aware API paths
|
|
| 17 |
async function apiFetch(apiKey, path, { method = 'GET', body, signal, headers: extraHeaders } = {}) {
|
| 18 |
const url = CLOUD.base + path;
|
| 19 |
const headers = {
|
| 20 |
-
'
|
| 21 |
'content-type': 'application/json',
|
| 22 |
'user-agent': UA,
|
| 23 |
'x-mona-agent': DEFAULTS.version,
|
|
|
|
| 17 |
async function apiFetch(apiKey, path, { method = 'GET', body, signal, headers: extraHeaders } = {}) {
|
| 18 |
const url = CLOUD.base + path;
|
| 19 |
const headers = {
|
| 20 |
+
'Authorization': `Bearer ${apiKey}`,
|
| 21 |
'content-type': 'application/json',
|
| 22 |
'user-agent': UA,
|
| 23 |
'x-mona-agent': DEFAULTS.version,
|
src/cloud.js
CHANGED
|
@@ -13,7 +13,7 @@ const P = CLOUD.paths; // platform-aware API paths
|
|
| 13 |
async function apiFetch(path, { apiKey, method = 'POST', body, signal, headers: extraHeaders } = {}) {
|
| 14 |
const url = CLOUD.base + path;
|
| 15 |
const headers = {
|
| 16 |
-
'
|
| 17 |
'content-type': 'application/json',
|
| 18 |
'user-agent': UA,
|
| 19 |
'x-mona-agent': DEFAULTS.version,
|
|
|
|
| 13 |
async function apiFetch(path, { apiKey, method = 'POST', body, signal, headers: extraHeaders } = {}) {
|
| 14 |
const url = CLOUD.base + path;
|
| 15 |
const headers = {
|
| 16 |
+
'Authorization': `Bearer ${apiKey}`,
|
| 17 |
'content-type': 'application/json',
|
| 18 |
'user-agent': UA,
|
| 19 |
'x-mona-agent': DEFAULTS.version,
|