Skip to content

Conversation

@mathias82
Copy link

@mathias82 mathias82 commented Nov 22, 2025

This PR exposes several Undertow listener configuration options that were previously available in Undertow
but not exposed through Quarkus configuration.

Added configuration properties

quarkus.undertow.listener.disallowed-methods

  • List of HTTP methods that should be rejected with 405 Method Not Allowed
  • Useful for disabling unsafe methods such as TRACE or TRACK

quarkus.undertow.listener.record-request-start-time

  • Enables recording the request start timestamp in Undertow
  • Useful for logging, tracing and request timing

quarkus.undertow.listener.max-parameters

  • Specifies the maximum number of allowed HTTP parameters
  • Provides protection against parameter-based DoS attacks

Motivation

These settings improve security hardening, observability, and request handling consistency.
By exposing them as Quarkus configuration options, applications can now configure Undertow behavior
directly through application.properties like other existing Undertow-related settings.

Documentation

Documentation has been added to: docs/src/main/asciidoc/http-reference.adoc

Notes

  • Default values align with Undertow defaults unless overridden.
  • Behavior is fully backward compatible.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from cf8cc5a to 0678b3b Compare November 22, 2025 22:06
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Nov 22, 2025

🎊 PR Preview f442026 has been successfully built and deployed to https://quarkus-pr-main-51182-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@mathias82 mathias82 force-pushed the undertow-listener-config branch 2 times, most recently from cb3e0d5 to f8a5e60 Compare November 22, 2025 23:37
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

Comment on lines 400 to 408
Set<String> disallowedMethods = servletRuntimeConfig.getValue().disallowedMethods()
.map(list -> {
Set<String> result = new java.util.HashSet<>();
for (String m : list) {
result.add(m.trim().toUpperCase(Locale.ROOT));
}
return result;
})
.orElse(Collections.emptySet());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please avoid these lambdas

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I’ve replaced the Optional.map with an explicit loop inside the recorder, so the code is now more straightforward @geoand

@geoand
Copy link
Contributor

geoand commented Nov 23, 2025

Thanks for the PR.

IIUC, the description of the PR is not correct as there are no listener related properties

@geoand geoand changed the title Expose Undertow listener configuration options (disallowed-methods, record-request-start-time, max-parameters) Expose Undertow listener configuration options Nov 23, 2025
@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch 3 times, most recently from ec81927 to 157b6cb Compare November 23, 2025 10:40
@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from 157b6cb to 16cc93c Compare November 23, 2025 10:57
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from 91b4f6d to 3c55137 Compare November 23, 2025 11:38
@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from a36afc9 to 898a0cc Compare November 23, 2025 12:03
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

|===
|Configuration property |Type |Default |Description

|`quarkus.undertow.listener.disallowed-methods`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct, as the property is quarkus.undertow.disallowed-methods

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Example:
----
quarkus.undertow.listener.disallowed-methods=TRACE,TRACK
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

quarkus.undertow.listener.disallowed-methods=TRACE,TRACK
----

|`quarkus.undertow.listener.record-request-start-time`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

|If enabled, Undertow records the request start timestamp.
Useful for timing, logging and request tracing.

|`quarkus.undertow.listener.max-parameters`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mathias82 mathias82 force-pushed the undertow-listener-config branch from 898a0cc to 8009a6a Compare November 24, 2025 07:58
@quarkus-bot quarkus-bot bot added area/docstyle issues related for manual docstyle review area/oidc labels Nov 24, 2025
@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from 127fb39 to a840319 Compare November 24, 2025 09:21
@geoand geoand force-pushed the undertow-listener-config branch from a840319 to 28a2486 Compare November 24, 2025 09:25
@mathias82 mathias82 force-pushed the undertow-listener-config branch 2 times, most recently from 0348d4e to e8209c9 Compare November 24, 2025 09:42
@quarkus-bot quarkus-bot bot added area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven area/panache labels Nov 24, 2025
@mathias82 mathias82 force-pushed the undertow-listener-config branch from e8209c9 to 867a4ce Compare November 24, 2025 10:00
@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from c7d44d5 to 867a4ce Compare November 24, 2025 10:38
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@mathias82 mathias82 force-pushed the undertow-listener-config branch from 39db9e6 to 2fdbc27 Compare November 24, 2025 14:38
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 24, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 2fdbc27.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/docstyle issues related for manual docstyle review area/documentation area/maven area/oidc area/panache area/undertow triage/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable configuration of Undertow listener attributes (disallowed-methods, record-request-start-time, max-parameters)

2 participants