Skip to content

Commit f9b1049

Browse files
authored
Merge pull request #63 from Qtoss-AI/jason_dev
Jason dev
2 parents 92994da + 85d4cf1 commit f9b1049

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightInstance.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,20 @@ public async Task HandleFetchResponse(IResponse response, MessageInfo message, P
150150
ResponseInMemory = args.ResponseInMemory
151151
};
152152

153+
var html = await response.TextAsync();
153154
if (response.Headers["content-type"].Contains("application/json"))
154155
{
155156
if (response.Status == 200 && response.Ok)
156-
{
157-
var json = await response.JsonAsync();
158-
result.ResponseData = JsonSerializer.Serialize(json);
157+
{
158+
if (!string.IsNullOrWhiteSpace(html))
159+
{
160+
var json = await response.JsonAsync();
161+
result.ResponseData = JsonSerializer.Serialize(json);
162+
}
159163
}
160164
}
161165
else
162166
{
163-
var html = await response.TextAsync();
164167
result.ResponseData = html;
165168
}
166169

0 commit comments

Comments
 (0)