Skip to content

test: preserve consecutive spaces in multipart filenames - #1770

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/multipart-filename-consecutive-spaces
Nov 28, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/multipart-filename-consecutive-spaces

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 27, 2026

Copy link
Copy Markdown
Member

Motivation

The multipart suite covers a filename with one space, but does not pin preservation of consecutive spaces through both strict and streamed form data.

Modification

Use the existing form-data renderer and unmarshaller with a filename containing two spaces. Assert the literal quoted name in the strict output and compare parsed parts for both strict and streamed entities.

Result

Covers the filename boundary without changing the parser, renderer, or public API.

Tests

  • Focused multipart selection: 8/8 per Scala axis (2.13.18 and 3.3.9) on JDK 17, including six nearby existing controls. The new case uses the normal CRLF renderer in both inherited suites.
  • Scoped scalafmt and git diff --check passed. Full sbt build not run.

RFC 7578 §4.2.

Motivation:
Existing multipart cases cover ordered same-name files and optional
filename decoding but not literal consecutive ASCII spaces in filenames.

Modification:
Round-trip one short modeled multipart part through strict and streamed
form data. Assert the quoted filename in strict output and compare the
complete decoded part, including the name, content, and filename.

Result:
Both entity forms protect the existing behavior of preserving both
spaces. No production code, API, or network behavior changes.

Tests:
- JDK 17, Scala 2.13.18 and 3.3.9: 8/8 each across the two
  MultipartUnmarshallersSpec suite classes, including the new round-trip
  in each and the adjacent same-name and percent-decoding controls.
  Exact test source was compiled against source-matching cached runtime
  classes. The new fixture uses the normal renderer's CRLF in both suites.
- Scoped Scalafmt 3.11.5 and git diff --check passed.
- Full sbt CI was not run.

References:
Refs apache#1483 and apache#1497; RFC 7578 Section 4.2.
@He-Pin
He-Pin marked this pull request as ready for review November 27, 2026 18:35

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@He-Pin
He-Pin merged commit 47250ef into apache:main Nov 28, 2026
6 checks passed
@He-Pin
He-Pin deleted the test/multipart-filename-consecutive-spaces branch November 28, 2026 12:21
@pjfanning pjfanning added this to the 2.1.0 milestone Nov 29, 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