Currently any fetch request to a http or https address happening inside a Worker will hang indefinitely.
This can be reproduced by following these steps:
worker-fetch-test.html:
<!DOCTYPE html>
<script>
const worker = new Worker("worker-fetch-test.js");
worker.onmessage = (evt) => {
console.log(`Fetch request completed. Content: ${evt.data}`);
};
</script>
worker-fetch-test.js:
fetch("./test.file")
.then(response => response.text())
.then(text => self.postMessage(text));
test.file:
Fetch works correctly!
cd
into the folder containing the above filespython3 -m http.server 8080
http://localhost:8080/worker-fetch-test.html
in LadybirdThe hang occurs because EAGAIN
is returned when the response data is read.
I previously attempted to fix this issue in d0f88d4 but the change ended up having to be reverted.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too