Comments (11)
@cmorten -- Here you go! https://github.com/xyzshantaram/opine-content-length-bug
Sorry I couldn't work on it last year ;)
from opine.
@jeremythille Hi! I've run into the same issue, and I'm wondering if you've found a workaround yet -- this is kind of a deal breaker...
from opine.
@ No, actually I tried to remove Opine altogether and serve my files just with Deno, without a library, and so far it works well
from opine.
Heya @xyzshantaram, @jeremythille 👋
Do you have a minimal reproduceable example / gist / repo that I can use to try and debug this issue?
from opine.
Ha, no sorry (and it's new year's eve, and then I'm going on a trip so I don't really have time to set up a repo now). But I've put my whole server code in my original question, apart from the Angular files which are really generic HTML/CSS/JS files. Thanks for looking into this issue, and of course, happy new year :)
from opine.
@jeremythille That will work for a bit, I suppose.
@cmorten I can try to write one for you, it's a bit late where I am but I will try to post it by tomorrow!
from opine.
Thanks for the great repro @xyzshantaram!
I've identified the issue - with some of the changes moving to the new std/http server for 2.0.0
of opine a regression has been introduced where served files are now being closed before the stream has finished reading them.
I have an idea for a fix which can look into this afternoon 😄
The code has its own reader impl. which was needed originally, and to ensure resource cleanup this close loop was introduced. With the 2.0.0 changes we now use a readable stream for the response which is capable of closing the resource itself- suspect can bin off the hand rolled reader to fix the bug and also get a slight perf benefit 😄
from opine.
Hey @jeremythille @xyzshantaram I've just released 2.0.2
which I believe fixes the issue. If not please do reopen!
from opine.
from opine.
Ah, crap, I forgot to respond to this! @cmorten thanks a lot for the prompt fix, it worked perfectly! <3
from opine.
For the record, I still haven't tried @cmorten's fix, because I'm still trying to code a little server using native Deno code (for learning purposes, I want to understand how Deno works before using libraries), and I have the same issue without Opine.
For that matter, I have just opened a similar issue on Deno's repo: denoland/deno#13362
So... is it an Opine, or a Deno issue after all? :)
EDIT
It is a "me" issue! I forgot to encapsulate the inner await
in an anonymous function, it works now. Sorry folks.
from opine.
Related Issues (20)
- Calling req.body.read() in a post or put method crashes deno HOT 2
- Incompatible with Deno 1.14.0 HOT 4
- Dependency error, no exported member default for several dependencies HOT 1
- Cross-Platform Path Separatores in serveStatic HOT 1
- TS2305 ERROR in deps.ts with range-parser default export HOT 2
- Bug on deno std, or opine ??? HOT 4
- Outdated dependencies
- Getting a plain Deno Request object from an OpineRequest? HOT 8
- JSON middleware does not work on Deno Deploy HOT 1
- How to read a request received from a html form? HOT 2
- FormData parser middleware is missing HOT 1
- Deno.Buffer will be deprecated in Deno 2.0 HOT 1
- Type incompatibility with Deno 1.20.1 HOT 5
- Opine can't find template views on Deno Deploy HOT 3
- [QUESTION] how to send ReadableStream<Uint8Array>? HOT 2
- Requested module doesn't provide required data HOT 1
- How to upload file?? HOT 1
- Request protocol for WebSocket upgrade request is always http HOT 2
- server-sent-events with opine HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opine.