Skip to content

Commit 42fdf38

Browse files
authored
fix: do not pass Authorization header when authMethod is none (#1566)
1 parent d8b6a3d commit 42fdf38

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/inference/src/providers/providerHelper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ export abstract class TaskProviderHelper {
115115
* Prepare the headers for the request
116116
*/
117117
prepareHeaders(params: HeaderParams, isBinary: boolean): Record<string, string> {
118-
const headers: Record<string, string> = { Authorization: `Bearer ${params.accessToken}` };
118+
const headers: Record<string, string> = {};
119+
if (params.authMethod !== "none") {
120+
headers["Authorization"] = `Bearer ${params.accessToken}`;
121+
}
119122
if (!isBinary) {
120123
headers["Content-Type"] = "application/json";
121124
}

0 commit comments

Comments
 (0)