From 3e44df923fa3e7233323982b3faccd616399ee4a Mon Sep 17 00:00:00 2001 From: soichisumi Date: Sat, 25 Jan 2025 22:50:05 +0900 Subject: [PATCH 1/4] fix auth header --- lightrag/api/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index 36690ec9..0400aa5f 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -614,7 +614,7 @@ try { const response = await fetch('/health', { headers: { - 'Authorization': `Bearer ${localStorage.getItem('apiKey')}` + 'X-API-Key': `${localStorage.getItem('apiKey')}` } }); From 9a99f3e3aecfab26a4009fb24f6693c72b40a276 Mon Sep 17 00:00:00 2001 From: soichisumi Date: Sat, 25 Jan 2025 22:50:41 +0900 Subject: [PATCH 2/4] fix auth of upload --- lightrag/api/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index 0400aa5f..74d5c59f 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -679,7 +679,7 @@ const response = await fetch('/documents/upload', { method: 'POST', headers: { - 'Authorization': `Bearer ${localStorage.getItem('apiKey')}` + 'X-API-Key': `${localStorage.getItem('apiKey')}` }, body: formData }); From 49a632a7394600a329ff5a069213d7e9588f058c Mon Sep 17 00:00:00 2001 From: soichisumi Date: Sat, 25 Jan 2025 22:51:06 +0900 Subject: [PATCH 3/4] add fix --- lightrag/api/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index 74d5c59f..3a69f8c5 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -342,7 +342,7 @@ const response = await fetch('/documents/upload', { method: 'POST', headers: { - 'Authorization': `Bearer ${localStorage.getItem('apiKey') || ''}` + 'X-API-Key': `${localStorage.getItem('apiKey') || ''}` }, body: formData }); From 763b32177df6a8e134c33f61b5299ef8d6241593 Mon Sep 17 00:00:00 2001 From: soichisumi Date: Sat, 25 Jan 2025 22:51:35 +0900 Subject: [PATCH 4/4] last one request with auth --- lightrag/api/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index 3a69f8c5..33a618a1 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -486,7 +486,7 @@ method: 'POST', headers: { 'Content-Type': 'application/json', - 'Authorization': `Bearer ${localStorage.getItem('apiKey') || ''}` + 'X-API-Key': `${localStorage.getItem('apiKey') || ''}` }, body: JSON.stringify({ query }) });