Skip to content

Conversation

@daanjanschouten
Copy link

@daanjanschouten daanjanschouten commented Jan 17, 2026

This change exposes bytesRead() on RequestContext for use in application code. The implementation tracks bytes at the I/O layer via an Undertow conduit wrapper, providing accurate measurements with minimal overhead.

The byte count is stored using the existing attachment mechanism, in line with how the existing UNVERIFIED_JWT and FAILURE attachments are used. For requests with empty bodies, Undertow may not create an input conduit, in which case bytesRead() returns 0.

This change is a better version of #2771 because it exposes significantly less API surface area.

After this PR

==COMMIT_MSG==
Adds bytesRead() method to RequestContext
==COMMIT_MSG==

@changelog-app
Copy link

changelog-app bot commented Jan 17, 2026

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Adds bytesRead() method to RequestContext

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link

changelog-app bot commented Jan 17, 2026

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

✨ Features

  • Adds bytesRead() method to RequestContext (#2776)

@daanjanschouten daanjanschouten marked this pull request as ready for review January 18, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants