Repository navigation
Normalize multipart requests converted from WebTestClient - #1092
Closed
AbineshDev01 wants to merge 1 commit into
Closed
AbineshDev01 wants to merge 1 commit into
AbineshDev01 wants to merge 1 commit into
Conversation
Represent successfully parsed multipart requests using their parts only and remove the transport boundary while retaining other media type parameters. Preserve unparsed raw content, read complete file parts and retain multipart bodies for DELETE HTTP snippets. Fixes spring-projectsgh-1075 Signed-off-by: Abinesh <abineshr8525@gmail.com>
Member
|
Thanks for the PR, but @chuuminggg has already offered to contribute a fix and we're happy to wait for that to happen. |
Author
|
Understood. I’ll leave #1075 to @chuuminggg and won’t pursue this PR further. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix multipart request snippets produced with WebTestClient so that the request is represented by its parsed parts rather than both those parts and the raw multipart payload.
Fixes #1075.
Root Cause
WebTestClientRequestConvertersupplies the wire body and the parsed parts toOperationRequestFactory. This makes curl combine-Fand-d, HTTPie combine request items and stdin, and the HTTP request snippet append its own boundary to the original transport boundary.Changes
This targets 4.0.x, matching the issue's milestone and recent fixes. The newer RestTestClient converter on main has the same original problem and will need the corresponding normalization when this change is forward-ported; that module does not exist on 4.0.x.
Testing
Observed the new multipart regressions fail against the original converter (20 tests, 4 failures); observed separate uppercase-boundary, multipart DELETE, and 300 KB file regressions fail before their corrections.
./gradlew test --no-daemon --no-parallel --max-workers=2 -Dorg.gradle.jvmargs='-Xmx1536m -Dfile.encoding=UTF-8'— passed, 1,122 tests, zero failures/errors/skipped test cases (61 Asciidoctor, 945 core, 77 MockMvc, 39 WebTestClient). The docs project's test task is disabled by its existing build convention../gradlew :spring-restdocs-core:format :spring-restdocs-webtestclient:format ...— passed; formatting was run separately because combining format and compile in one invocation triggers Gradle 9's existing implicit-dependency validation../gradlew build --continue --init-script /path/to/private/javadoc-tool.gradle --no-daemon --no-parallel --max-workers=2 -Dorg.gradle.jvmargs='-Xmx1536m -Dfile.encoding=UTF-8'— passed, including compilation/NullAway, checkstyle main/test/test-fixtures, formatting, NoHTTP, jars/Javadocs and Antora documentation. Gradle, npm and XDG caches were directed to writable workspace directories; no checks were excluded. Existing Javadoc missing-constructor-comment and VM/color warnings were nonfatal.Tooling: isolated Temurin 21.0.13 for Gradle/compiler/tests, Java 17 release target unchanged. The initially installed 21.0.2 was too old for NullAway JSpecify mode. The build unconditionally requests
--no-fonts, which JDK 21 Javadoc does not support, so a private external Gradle init script selects the installed JDK 27 Javadoc executable only; no project build files or checks are changed/disabled.AI assistance was used for investigation, implementation, and tests; the final diff also received independent review, whose correctness findings were reproduced with regression tests and addressed.