Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
2b43f26
Bump maven-jar-plugin from 3.2.0 to 3.2.2
dependabot[bot] Apr 4, 2022
a87e032
chore: Set permissions for GitHub actions
naveensrinivasan Apr 21, 2022
c979bdd
Add httpsOnly option
U1F984 Apr 29, 2022
5807c16
FileUpload is missing in a MVC controller fix #2570
jknack May 1, 2022
a527fb1
Merge pull request #2571 from U1F984/https-only
jknack May 1, 2022
174c016
build: fix checkstyle errors
jknack May 1, 2022
39a8b11
Merge pull request #2564 from turrisxyz/setup-permissions
jknack May 1, 2022
261326f
Bump vue from 3.0.3 to 3.2.33
dependabot[bot] May 2, 2022
15a289e
netty: onComplete callback should run on caller thread. Fix #2572
jknack May 2, 2022
405d421
dependencies: jetty upgrade
jknack May 2, 2022
051ff59
Merge pull request #2573 from jooby-project/dependabot/maven/org.webj…
jknack May 2, 2022
ffeb642
Merge pull request #2556 from jooby-project/dependabot/maven/org.apac…
jknack May 2, 2022
63f3a2e
@Transactional annotation must be supported at class/type level too f…
jknack May 2, 2022
6c709ff
jooby-cli: doesn't add src/main/resources while generating maven proj…
jknack May 2, 2022
ef62ad5
v2.14.1
jknack May 2, 2022
5af6008
prepare for next development cycle
jknack May 2, 2022
af27bcb
Bump netty.version from 4.1.76.Final to 4.1.77.Final
dependabot[bot] May 9, 2022
9ee3c34
Bump lettuce-core from 6.1.6.RELEASE to 6.1.8.RELEASE
dependabot[bot] May 9, 2022
b6707bc
Bump mockito.version from 4.4.0 to 4.5.1
dependabot[bot] May 9, 2022
4874486
Merge pull request #2581 from jooby-project/dependabot/maven/mockito.…
jknack May 9, 2022
aacf570
Merge pull request #2580 from jooby-project/dependabot/maven/io.lettu…
jknack May 9, 2022
7305488
Merge pull request #2579 from jooby-project/dependabot/maven/netty.ve…
jknack May 9, 2022
f1da6d9
Add a queue for hotreload to group changes
agentgt May 9, 2022
89cc4af
Fix unit test for new jooby run for wait time
agentgt May 9, 2022
d0b1a4a
Make sonatype-lift happy
agentgt May 9, 2022
b408005
Merge pull request #2583 from agentgt/issues/2577_hotreload
jknack May 10, 2022
42b24b1
jooby-run: Add waitTimeBeforeRestart to gradle plugin
jknack May 10, 2022
cf93070
jooby-run: document waitTimeBeforeRestart. See #2577
jknack May 11, 2022
c0d82e4
build: add gradle compile to pipeline
jknack May 11, 2022
2fddb0c
build: revert gradle integration from build
jknack May 11, 2022
1143bd6
WebSocket: Fix raise condition while sending a message on connect
jknack May 14, 2022
14de379
version bump: upgrade dependencies
jknack May 14, 2022
ef55836
v2.14.2
jknack May 15, 2022
2634521
prepare for next development cycle
jknack May 15, 2022
b6b606c
build: run on 17 and latest
jknack May 15, 2022
ef7ec3f
build: revert build on jdk 17
jknack May 15, 2022
bbbb14e
Bump rest-assured from 4.3.3 to 5.0.1
dependabot[bot] May 16, 2022
012185d
Bump logback-classic from 1.2.9 to 1.2.11
dependabot[bot] May 16, 2022
0b857e9
Bump directory-watcher from 0.15.0 to 0.15.1
dependabot[bot] May 16, 2022
1e8f8b5
kotlin: upgrade to 1.6.x fix #2592
jknack May 18, 2022
48ea1b2
Merge pull request #2588 from jooby-project/dependabot/maven/io.rest-…
jknack May 18, 2022
7ddc8df
Merge pull request #2591 from jooby-project/dependabot/maven/io.methv…
jknack May 18, 2022
a8bebc2
Merge pull request #2590 from jooby-project/dependabot/maven/ch.qos.l…
jknack May 18, 2022
7335467
build(deps): bump slf4j.version from 1.7.32 to 1.7.36
dependabot[bot] May 18, 2022
d489ac8
mvc: don't generate send call on void controller method
jknack May 19, 2022
18758a4
type analyzer: detects completablefuture from kotlin
jknack May 20, 2022
9367813
build: fix random failure caused by GC?
jknack May 20, 2022
f25d3ae
build: upgrade gradle + use java 17/18
jknack May 20, 2022
fe6dcc7
Merge pull request #2593 from jooby-project/dependabot/maven/slf4j.ve…
jknack May 20, 2022
49ed759
build: fix random failure caused by raise condition
jknack May 20, 2022
2e6243b
v2.15.0
jknack May 22, 2022
e597315
prepare for next development cycle
jknack May 22, 2022
af980f5
Application startup resulted in exception: Caused by: java.lang.Class…
jknack May 27, 2022
1484ff7
dependencies: version bump
jknack May 27, 2022
eb3bfac
v2.15.1
jknack May 28, 2022
6d0d333
prepare for next development cycle
jknack May 28, 2022
32cda3f
[openapi] Duplicated endpoints for the mounted applications fix #2594
jknack May 28, 2022
e22d03d
Fix typo ("NO_CONENT" => "NO_CONTENT")
lukasbarti Jun 12, 2022
e10afbb
Merge pull request #2605 from lukasbarti/patch-1
jknack Jul 4, 2022
88df159
build(deps): bump aws-java-sdk-s3 in /modules/jooby-bom
dependabot[bot] Jul 15, 2022
94e1e39
App should return 400 code if file form field is missing
extbe Jul 21, 2022
4921171
Merge pull request #2612 from extbe/fix/issue-2611
jknack Jul 25, 2022
9481d17
Add FUNDING/sponsor file
jknack Jul 29, 2022
23e1541
Fix httpsOnly config file example
jryan128 Aug 4, 2022
1400b68
build(deps): bump undertow-core in /modules/jooby-bom
dependabot[bot] Aug 18, 2022
e97cd38
build(deps): bump undertow-core from 2.2.17.Final to 2.2.19.Final
dependabot[bot] Aug 18, 2022
11c6097
build(deps): bump jsoup from 1.14.2 to 1.15.3 in /docs
dependabot[bot] Sep 1, 2022
e7b6212
build(deps-dev): bump jsoup in /modules/jooby-whoops
dependabot[bot] Sep 1, 2022
d62c04c
cli: move configuration files to `.config/jooby.conf` fixes #2599
jknack Sep 5, 2022
47801e1
Merge pull request #2615 from jryan128/jryan128-patch-1
jknack Sep 5, 2022
d4dc0d5
Merge pull request #2618 from jooby-project/dependabot/maven/io.under…
jknack Sep 5, 2022
fe7e1f1
Merge pull request #2621 from jooby-project/dependabot/maven/modules/…
jknack Sep 5, 2022
120aee8
Merge pull request #2617 from jooby-project/dependabot/maven/modules/…
jknack Sep 5, 2022
c60da54
Merge pull request #2610 from jooby-project/dependabot/maven/modules/…
jknack Sep 5, 2022
cc4cdc1
Merge pull request #2620 from jooby-project/dependabot/maven/docs/org…
jknack Sep 5, 2022
aac8aaf
version bump: upgrade major dependencies
jknack Sep 6, 2022
de306b3
doc: Number of worker threads fixes #2616
jknack Sep 6, 2022
9ae88d4
ServerOptions#setHost missing a 0? fixes #2614
jknack Sep 6, 2022
9640984
encoder: should consider route produce types, fixes #2613
jknack Sep 6, 2022
2ed1342
v2.16.0
jknack Sep 6, 2022
157a1c1
prepare for next development cycle
jknack Sep 6, 2022
9329462
Regression: Bug: Fix NullPointerException, will fixing content negota…
jknack Sep 6, 2022
4d7be54
v2.16.1
jknack Sep 6, 2022
0f5e57a
prepare for next development cycle
jknack Sep 6, 2022
a420491
version: upgrade jooby dependencies
jknack Oct 24, 2022
82c4281
Preflight requests fail with 415 when MVC Controller method has @Cons…
jknack Oct 24, 2022
0a4b38a
version: updates bom file
jknack Oct 29, 2022
ad803e8
dependencies: upgrade dependencies
jknack Oct 30, 2022
0ad1485
Added jax-rs path-param
dmitryb-dev Nov 2, 2022
1d36d73
Merge pull request #2667 from dmitryb-dev/add-jax-rs-path-param
jknack Nov 3, 2022
a5558d5
version bump
jknack Nov 26, 2022
89ea421
Merge pull request #2673 from jooby-project/versionbump
jknack Nov 27, 2022
e1e122d
Reproducible byte for byte jars fix #2670
jknack Nov 27, 2022
30cd4e5
version bump: upgrade h2
jknack Nov 27, 2022
7088fd3
build+deps: get back build upgrade servers dependencies
jknack Dec 7, 2022
a7537a7
AccessLogger logs miss protocol and content length when using Kotlin …
jknack Dec 26, 2022
36cde51
version bump: upgrade major dependencies
jknack Mar 1, 2023
7d85f96
encoder: should consider all produce types before default TO_STRING
froque Mar 2, 2023
d61c655
Merge pull request #2805 from froque/2804_fix_regression_encoders_mul…
jknack Mar 2, 2023
25c4fdb
revert: Regression with encoder: should consider route produce types …
jknack Mar 4, 2023
81dcd67
build: rename test with wrong name
jknack Mar 4, 2023
7161820
build: remove System.out calls
jknack Mar 4, 2023
7a53ee1
2.15][Netty] Cannot access encoder in case of "413 Content Too Large"…
jknack Mar 4, 2023
fc8d753
Support for binary messages in WebSocket API fix #2497
jknack Feb 28, 2023
0006ced
Support for Websocket Heartbeat fix #2784
jknack Feb 28, 2023
57a8127
OpenApi jooby-maven-plugin incorrect generation in multi module maven…
jknack Feb 28, 2023
2fa18dd
v2.16.2
jknack Mar 4, 2023
5b01669
prepare for next development cycle
jknack Mar 4, 2023
3635d35
Bump ASM from 9.3 to 9.6 to enable support for Java 21
froque Oct 24, 2023
dee824b
Merge pull request #3196 from froque/upgrade_asm
jknack Oct 26, 2023
f7f289d
version bump:
jknack Oct 28, 2023
a44644f
v2.16.3
jknack Oct 28, 2023
69438ee
#3441 Bump Guice to 6.0.0
imeszaros Jun 4, 2024
e4f7b7d
Merge pull request #3442 from imeszaros/bump-guice
jknack Jun 4, 2024
d4fa18b
jetty: remove conscrypt dependency
jknack Jun 5, 2024
149998c
set version to 2.16.4
jknack Jun 5, 2024
b404283
version bump: upgrade servers
jknack Jun 5, 2024
08c9169
v2.16.4
jknack Jun 5, 2024
847e892
build: fix jetty ssl + gradle setup
jknack Jun 5, 2024
6965c8b
v2.16.4
jknack Jun 5, 2024
18a2a77
gradle-8.8
jknack Jun 6, 2024
1ab0210
prepare for next development cycle
jknack Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [jknack]
2 changes: 1 addition & 1 deletion .github/workflows/full-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [1.8, 11, 13]
java_version: [1.8, 11, 17, 18]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/quick-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: Quick Build

on: [pull_request]

permissions:
contents: read

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java_version: [1.8, 11, 13]
java_version: [1.8, 11, 17]
os: [ubuntu-latest]

steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/starter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
paths:
- 'starters/**'

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions docs/asciidoc/dev-tools.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ The next example shows all the available options with their default values:
<restartExtensions>conf,properties,class</restartExtensions> <2>
<compileExtensions>java,kt</compileExtensions> <3>
<port>8080</port> <4>
<waitTimeBeforeRestart>500</waitTimeBeforeRestart> <5>
</configuration>
</plugin>
...
Expand Down Expand Up @@ -137,11 +138,13 @@ joobyRun {
restartExtensions = ["conf", "properties", "class"] <2>
compileExtensions = ["java", "kt"] <3>
port = 8080 <4>
waitTimeBeforeRestart = 500 <5>
}
----

<1> Application main class
<2> Restart extensions. A change on these files trigger a restart request.
<3> Source extensions. A change on these files trigger a compilation request, followed by a restart request.
<4> Application port
<5> How long to wait after last file change to restart. Default is: `500` milliseconds.

6 changes: 3 additions & 3 deletions docs/asciidoc/execution-model.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,13 @@ workerThreads = Math.max(Runtime.getRuntime().availableProcessors(), 2) * 8
For example `8` cores gives us `64` worker threads.

- Undertow: The javadoc:utow.Utow[text=Undertow server] implementation multiply the number of available processors
(with a minimum of 2) by 8.
by 8.

----
workerThreads = Math.max(Runtime.getRuntime().availableProcessors(), 2) * 8
workerThreads = Runtime.getRuntime().availableProcessors() * 8
----

For example `8` cores gives us `64` worker threads.
For `8` cores gives us `64` worker threads.

- Jetty: The javadoc:jetty.Jetty[text=Jetty server] implementation uses the default configuration
with `200` worker threads.
Expand Down
2 changes: 1 addition & 1 deletion docs/asciidoc/modules/openapi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ and/or `@Operation` annotations.

==== Responses & Status

The default response code is `Success(200)` (or `NO_CONENT(204)` for DELETE mvc routes). Now, if
The default response code is `Success(200)` (or `NO_CONTENT(204)` for DELETE mvc routes). Now, if
you need to:

- document the default response
Expand Down
12 changes: 8 additions & 4 deletions docs/asciidoc/servers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Server options are available via javadoc:ServerOptions[] class:
.setMaxRequestSize(10485760)
.setSecurePort(8433)
.setSsl(SslOptions.selfSigned())
.setHttpsOnly(false)
.setHttp2(true)
.setExpectContinue(true)
);
Expand All @@ -70,8 +71,9 @@ Server options are available via javadoc:ServerOptions[] class:
maxRequestSize = 10485760
securePort = 8443
ssl = SslOptions.selfSigned()
http2 = true
expectContinue = true
isHttpsOnly = true
isHttp2 = true
isExpectContinue = true
}
}
----
Expand All @@ -87,8 +89,9 @@ Server options are available via javadoc:ServerOptions[] class:
- maxRequestSize: Maximum request size in bytes. Request exceeding this value results in 413(REQUEST_ENTITY_TOO_LARGE) response. Default is `10mb`.
- securePort: Enable HTTPS. This option is fully covered in next section.
- ssl: SSL options with certificate details. This option is fully covered in next section.
- http2: Enable HTTP 2.0.
- expectContinue: Whenever 100-Expect and continue requests are handled by the server. This is off
- isHttpsOnly: bind only to HTTPS port, not HTTP. This requires SSL options to be configured.
- isHttp2: Enable HTTP 2.0.
- isExpectContinue: Whenever 100-Expect and continue requests are handled by the server. This is off
by default, except for Jetty which is always ON.

Server options are available as application configuration properties too:
Expand All @@ -107,6 +110,7 @@ server.defaultHeaders = true
server.maxRequestSize = 10485760
server.securePort = 8443
server.ssl.type = self-signed | PKCS12 | X509
server.httpsOnly = false
server.http2 = true
server.expectContinue = false
----
Expand Down
6 changes: 3 additions & 3 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.jooby</groupId>
<artifactId>jooby-project</artifactId>
<version>2.14.1-SNAPSHOT</version>
<version>2.16.5-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -56,7 +56,7 @@
<dependency>
<groupId>io.methvin</groupId>
<artifactId>directory-watcher</artifactId>
<version>0.15.0</version>
<version>0.15.1</version>
</dependency>

<!-- zt-exec -->
Expand All @@ -70,7 +70,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.2</version>
<version>1.15.3</version>
</dependency>

</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions jooby/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.jooby</groupId>
<artifactId>jooby-project</artifactId>
<version>2.14.1-SNAPSHOT</version>
<version>2.16.5-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -277,7 +277,7 @@
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>vue</artifactId>
<version>3.0.3</version>
<version>3.2.33</version>
<scope>test</scope>
</dependency>

Expand Down
9 changes: 9 additions & 0 deletions jooby/src/main/java/io/jooby/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,15 @@ public interface Context extends Registry {
*/
@Nullable MediaType getRequestType();

/**
* Test whenever this is a CORS preflight request.
*
* @return Test whenever this is a CORS preflight request.
*/
default boolean isPreflight() {
return getMethod().equals(Router.OPTIONS) && !header("Access-Control-Request-Method").isMissing();
}

/**
* Request <code>Content-Type</code> header or <code>null</code> when missing.
*
Expand Down
6 changes: 1 addition & 5 deletions jooby/src/main/java/io/jooby/CorsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public CorsHandler() {
return ctx.send(StatusCode.FORBIDDEN);
}
log.debug("allowed origin: {}", origin);
if (isPreflight(ctx)) {
if (ctx.isPreflight()) {
log.debug("handling preflight for: {}", origin);
if (preflight(ctx, options, origin)) {
return ctx;
Expand Down Expand Up @@ -135,10 +135,6 @@ private static void simple(final Context ctx, final Cors options, final String o
route.setHttpOptions(true);
}

private boolean isPreflight(final Context ctx) {
return ctx.getMethod().equals(Router.OPTIONS) && !ctx.header(AC_REQUEST_METHOD).isMissing();
}

private boolean preflight(final Context ctx, final Cors options, final String origin) {
/*
Allowed method
Expand Down
3 changes: 2 additions & 1 deletion jooby/src/main/java/io/jooby/DefaultContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -205,7 +206,7 @@ public interface DefaultContext extends Context {
}

@Override default boolean accept(@Nonnull MediaType contentType) {
return accept(singletonList(contentType)) == contentType;
return Objects.equals(accept(singletonList(contentType)), contentType);
}

@Override default MediaType accept(@Nonnull List<MediaType> produceTypes) {
Expand Down
14 changes: 8 additions & 6 deletions jooby/src/main/java/io/jooby/Jooby.java
Original file line number Diff line number Diff line change
Expand Up @@ -893,17 +893,19 @@ public Jooby errorCode(@Nonnull Class<? extends Throwable> type,
log.info(" app dir: {}", System.getProperty("user.dir"));
log.info(" tmp dir: {}", tmpdir);

List<Object> args = new ArrayList<>();
StringBuilder buff = new StringBuilder();
buff.append("routes: \n\n{}\n\nlistening on:\n");
args.add(router);

ServerOptions options = server.getOptions();
String host = options.getHost().replace("0.0.0.0", "localhost");
List<Object> args = new ArrayList<>();
args.add(router);
args.add(host);
args.add(options.getPort());
args.add(router.getContextPath());
buff.append(" http://{}:{}{}\n");
if (!options.isHttpsOnly()) {
args.add(host);
args.add(options.getPort());
args.add(router.getContextPath());
buff.append(" http://{}:{}{}\n");
}

if (options.isSSLEnabled()) {
args.add(host);
Expand Down
21 changes: 15 additions & 6 deletions jooby/src/main/java/io/jooby/Route.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.jooby.exception.MethodNotAllowedException;
import io.jooby.exception.NotAcceptableException;
import io.jooby.exception.NotFoundException;
import io.jooby.exception.StatusCodeException;
import io.jooby.exception.UnsupportedMediaType;

import javax.annotation.Nonnull;
Expand Down Expand Up @@ -309,6 +310,12 @@ public interface Handler extends Serializable, Aware {
public static final Handler NOT_FOUND = ctx -> ctx
.sendError(new NotFoundException(ctx.getRequestPath()));

/**
* Handler for {@link StatusCode#REQUEST_ENTITY_TOO_LARGE} responses.
*/
public static final Handler REQUEST_ENTITY_TOO_LARGE = ctx -> ctx
.sendError(new StatusCodeException(StatusCode.REQUEST_ENTITY_TOO_LARGE));

/**
* Handler for {@link StatusCode#METHOD_NOT_ALLOWED} responses.
*/
Expand Down Expand Up @@ -337,12 +344,14 @@ public interface Handler extends Serializable, Aware {

/** Handler for {@link StatusCode#UNSUPPORTED_MEDIA_TYPE} responses. */
public static final Route.Before SUPPORT_MEDIA_TYPE = ctx -> {
MediaType contentType = ctx.getRequestType();
if (contentType == null) {
throw new UnsupportedMediaType(null);
}
if (!ctx.getRoute().getConsumes().stream().anyMatch(contentType::matches)) {
throw new UnsupportedMediaType(contentType.getValue());
if (!ctx.isPreflight()) {
MediaType contentType = ctx.getRequestType();
if (contentType == null) {
throw new UnsupportedMediaType(null);
}
if (!ctx.getRoute().getConsumes().stream().anyMatch(contentType::matches)) {
throw new UnsupportedMediaType(contentType.getValue());
}
}
};

Expand Down
6 changes: 5 additions & 1 deletion jooby/src/main/java/io/jooby/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ interface Match {
*/
@Nonnull Route route();

void execute(@Nonnull Context context);
void execute(@Nonnull Context context, @Nonnull Route.Handler pipeline);

default void execute(@Nonnull Context context) {
execute(context, route().getPipeline());
}

/**
* Path pattern variables.
Expand Down
Loading