Skip to content

Commit

Permalink
Only pass non-empty auth header.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccmaymay committed Sep 7, 2023
1 parent 0fe11d8 commit a4eeb08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,13 @@ A:`,
return this.apiKey && BASE_64_REGEX.test(this.apiKey) ? this.apiKey : "";
},
sandleHeaders() {
return {
const h = {
"Content-Type": "application/json",
Authorization: `Bearer ${this.safeAPIKey}`,
};
if (this.safeAPIKey) {
h["Authorization"] = `Bearer ${this.safeAPIKey}`;
}
return h;
},
completionSuffix() {
return JSON.parse('"' + this.completionSuffixJSONString + '"');
Expand Down Expand Up @@ -415,6 +418,7 @@ A:`,
const response = await axios.get(url, {
headers: this.sandleHeaders,
});
console.log(response.data.data);
return response.data.data;
},
async redoPreviousCompletions() {
Expand Down

0 comments on commit a4eeb08

Please sign in to comment.