Skip to content

Preserve HTTP form encoder configuration - #4331

Open
Gimini-3 wants to merge 1 commit into
reactor:mainfrom
Gimini-3:fix-form-encoder-configuration
Open

Gimini-3 wants to merge 1 commit into
reactor:mainfrom
Gimini-3:fix-form-encoder-configuration

Conversation

@Gimini-3

@Gimini-3 Gimini-3 commented Aug 8, 2026

Copy link
Copy Markdown

Fixes #4330

What changed

  • Preserve pending charset, encoding mode, multipart, factory, and cleanup configuration across encoder rebuilds.
  • Apply pending encoder changes before adding form parts so a custom HttpDataFactory actually owns the created data.
  • Route later builder calls and cleanup to the latest encoder, including callback-failure cleanup.
  • Align the cleanOnTerminate Javadoc with its actual default.

Failing regression coverage

Before the fix, the new tests demonstrate two observable setter-order failures:

charset(ISO_8859_1).multipart(false): key=%C3%A9
expected:                               key=%E9

encoding(RFC3986).multipart(false): key=*
expected:                          key=%2A

They also verify that cleanOnTerminate(false) survives charset, encoding, multipart, and factory-triggered rebuilds, and that both normal and callback-failure paths clean the configured custom factory.

Scope

The production change is limited to HTTP client form configuration/rebuild and error cleanup:

  • HttpClientForm
  • HttpClientFormEncoder
  • HttpClientOperations.SendForm

Tests cover both the encoder directly and real HTTP form uploads.

Validation

  • HttpClientFormEncoderTests: 9 passed
  • HttpClientWithTomcatTest: 15 passed
  • checkstyleMain, checkstyleTest, and spotlessCheck: passed
  • Full reactor-netty-http suite: 2,888 tests executed; one unrelated SNI handshake-timeout test failed once and passed on isolated rerun

Signed-off-by: Gimin Kim <138752849+Gimini-3@users.noreply.github.com>
@Gimini-3
Gimini-3 force-pushed the fix-form-encoder-configuration branch from 5464a4c to 4fe21fe Compare August 8, 2026 06:26
@Gimini-3
Gimini-3 marked this pull request as ready for review August 8, 2026 06:30
@violetagg violetagg added the type/bug A general bug label Aug 10, 2026
@violetagg violetagg added this to the 1.3.8 milestone Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HttpClientForm settings can be lost depending on multipart setter order

2 participants