You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a workable solution would be something to the effect of this: wrap the response stream with a wrapper which keeps track of written bytes correctly whether or not there is a gzipped stream in between or not, and add the content length header after done.
Did some experimentation. The approach does somewhat work, but there's a big problem with setting the length header and flushing the stream - if the "final flush" is left last, content length doesn't reflect possible unflushed bytes, but if flushing is done first, it commits the response and the header will not be set.
Catching the flush and setting the header before propagating the flush to the underlying servlet output stream should work.
This is what happens when trying to download a static file hosted on Sparkjava (by using
Spark.externalStaticFileLocation(rootFolder + "static");
)I'm not a 100% Java/HTML/header magic expert, but I think it doesn't show the file progress because the file size header isn't sent, right?
The text was updated successfully, but these errors were encountered: