Skip to content

Commit fc4a269

Browse files
fix(client): handle multiple auth options gracefully
1 parent 4625b19 commit fc4a269

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Scrapegraphai/ParamsBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ protected string QueryString(IScrapegraphaiClient client)
149149

150150
protected static void AddDefaultHeaders(HttpRequestMessage request, IScrapegraphaiClient client)
151151
{
152-
request.Headers.Add("SGAI-APIKEY", client.APIKey);
152+
if (client.APIKey != null)
153+
{
154+
request.Headers.Add("SGAI-APIKEY", client.APIKey);
155+
}
153156
}
154157
}

0 commit comments

Comments
 (0)