Comments (5)
Jooby 3.1 moved to jetty 12, so yea it is possible. Can you provide an example to reproduce the bug?
from jooby.
@jknack, it is just:
get("/test.zip", ctx -> {
ctx.setResponseType("application/zip");
return Path.of("test.zip");
});
Does not work or only works very very rarely.
Changing to this makes it work:
get("/test.zip", ctx -> {
ctx.setResponseType("application/zip");
return Files.newInputStream(Path.of("test.zip"));
});
from jooby.
My test file is 70 MB for reference but it also happens with small files.
from jooby.
@ogrammer with a zip file of 25mb, the following test executed successfully all times:
public class Issue3437 {
@ServerTest(iterations = 1000, server = JettyServer.class)
public void shouldRenderPathInstances(ServerTestRunner runner) {
runner.define(app -> {
app.get("/test.zip", ctx -> {
ctx.setResponseType("application/zip");
return Path.of("/Users/edgar/Downloads/test.zip");
});
}).ready(http -> {
http.get("/test.zip", rsp -> {
assertEquals(200, rsp.code());
});
});
}
}
from jooby.
@jknack You need to try with firefox not jooby http client. It happens with firefox and i am certain it is a jooby or jetty bug because it does not happen in versions before 3.1.x and also does not happen if I use InputStream instead of Path (which jooby makes into a FileChannel)
from jooby.
Related Issues (20)
- WebSocket onClose not called for Netty HOT 1
- netty: memory leak while reading HTTP body HOT 2
- Java strings not escaped properly in mvc source code generation. HOT 2
- DataBuffer interface needs reference to Spring Project and proper nullable annotations. HOT 1
- Maybe consider using package-info.java for default nonnull returns
- jooby-apt: MVC generated controllers require `jakarta-inject` should be documented because of code generation. HOT 2
- Support OpenAPI @io.swagger.v3.oas.annotations.Parameter on method parameters
- jooby-apt should not depend on commons-text which depends on commons-lang3 HOT 2
- SingleValue converter exceptions need "name" in the exception. HOT 5
- @Param name attribute is being ignored by MVC APT code generator. HOT 1
- jooby-apt: must add leading slash on path pattern
- jooby-apt: generate constructors from source controllers
- undertow: multipart field may actually be a file
- mvc: Add `BindParam` annotation for custom parsing/mapping
- context path/path map uses incorrect keys on mount
- jooby-apt: compilation error while using generics on controller
- kotlin: Java type mismatch on @Transactional during compile time HOT 2
- Jooby Hibernate: "Session/EntityManager is closed" in the second call HOT 4
- SSE: Spec Interpretation Issue (preserve leading spaces) HOT 1
- Is it possible to attach handlers to only specific routes? HOT 8
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 jooby.