Skip to content

Commit

Permalink
Merge pull request #7 from orange104/fix-stream
Browse files Browse the repository at this point in the history
fix: the logic error in determining non-streaming output
  • Loading branch information
barretlee authored Apr 6, 2023
2 parents 2bf3978 + 0328550 commit 44c732b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cloudflare-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function handleRequest(request) {

// 入参中如果包含了 stream=true,则表现形式为非流式输出
const response = await fetch(fetchAPI, payload);
if (body && body.stream && body.stream === false) {
if (body && body.stream !== true) {
const results = await response.json();
return new Response(JSON.stringify(results), {
status: response.status,
Expand Down

0 comments on commit 44c732b

Please sign in to comment.