Skip to content

use getEnd() not getLength() when filtering ctls in header writers#1018

Merged
rmaucher merged 1 commit into
apache:mainfrom
sahvx655-wq:header-ctl-filter-bound
Jun 3, 2026
Merged

use getEnd() not getLength() when filtering ctls in header writers#1018
rmaucher merged 1 commit into
apache:mainfrom
sahvx655-wq:header-ctl-filter-bound

Conversation

@sahvx655-wq
Copy link
Copy Markdown
Contributor

while reading the response header write path i noticed the control-character filter in Http11OutputBuffer.write and AjpMessage.appendBytes loops up to bc.getLength() rather than the end of the data. for a ByteChunk the valid range is [getStart(), getEnd()) and getLength() is getEnd() minus getStart(), so when the chunk start is non-zero the bytes past getLength() are never stripped, and if start is past length the loop does not run at all. the same byte filtering loops in Http11Processor, StreamProcessor and UEncoder all use getEnd(). this brings these two into line.

@rmaucher rmaucher merged commit c1e278e into apache:main Jun 3, 2026
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