Skip to content

Commit

Permalink
fix(cloudflare): fix missing body when no filter
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwurtz committed Jul 8, 2022
1 parent af02c4e commit d62a966
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worker/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ function create_redirectionio_request(request, libredirectionio, clientIp) {
redirectionioRequest.add_header(pair[0], pair[1]);
}

redirectionioRequest.set_remote_ip(clientIp);
if (clientIp) {
redirectionioRequest.set_remote_ip(clientIp);
}

return redirectionioRequest;
}
Expand Down Expand Up @@ -163,7 +165,7 @@ async function proxy(request, redirectionioRequest, action, options, libredirect

// Skip body filtering
if (bodyFilter.is_null()) {
return response;
return [response, response.status];
}

const { readable, writable } = new TransformStream();
Expand Down

0 comments on commit d62a966

Please sign in to comment.