Skip to content

test: tidy up recent media type registrations - #1526

Merged
pjfanning merged 1 commit into
apache:mainfrom
pjfanning:tidy-media-type-registrations
Nov 21, 2026
Merged

pjfanning merged 1 commit into
apache:mainfrom
pjfanning:tidy-media-type-registrations

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Motivation

#1522 (text/javascript), #1523 (application/manifest+json) and #1524 (audio/aac) put their registry tests in HeaderSpec instead of the existing MediaTypesSpec, mixed in control assertions unrelated to the type being added (css, unknown-extension, mp3), and added three separate docs paragraphs at different points in the "Registering Custom Media Types" section, which is about custom types.

Modification

  • Move the registry tests from HeaderSpec to MediaTypesSpec, keeping all the relevant assertions (including the .json/.manifest no-clash checks) and dropping the unrelated controls. Drop the audio/mpeg control from the Java AAC test.
  • Collect the default extension mappings in a new "File Extension Mappings" docs section.
  • Align the text/javascript val with its neighbours and drop the stray blank lines around TEXT_JAVASCRIPT in the Java constants.

Result

Media type tests and docs each live in one place. No behaviour or API change.

Tests

  • sbt "http-core / testOnly org.apache.pekko.http.scaladsl.model.MediaTypesSpec org.apache.pekko.http.scaladsl.model.headers.HeaderSpec org.apache.pekko.http.javadsl.model.HttpMessageTest": 50 passed
  • scalafmt run on changed Scala files; docs build not run locally

References

Refs #1522, #1523, #1524

Motivation:
The text/javascript, application/manifest+json and audio/aac changes
(apache#1522, apache#1523, apache#1524) put their registry tests in HeaderSpec rather than
MediaTypesSpec, mixed in unrelated control assertions, and scattered
their docs notes through the "Registering Custom Media Types" section.

Modification:
Move the registry tests to MediaTypesSpec, dropping the unrelated
css/unknown-extension/mp3 assertions. Collect the default extension
mappings in a "File Extension Mappings" docs section. Align the
text/javascript val and drop stray blank lines around TEXT_JAVASCRIPT.

Result:
Media type tests and docs live in one place each. No behaviour change.

Tests:
- sbt "http-core / testOnly ...MediaTypesSpec ...HeaderSpec
  ...HttpMessageTest": 50 passed

References:
Refs apache#1522, apache#1523, apache#1524
@pjfanning
pjfanning requested a review from He-Pin November 20, 2026 21:21
@pjfanning
pjfanning merged commit 54c4132 into apache:main Nov 21, 2026
5 of 6 checks passed
@pjfanning
pjfanning deleted the tidy-media-type-registrations branch November 21, 2026 07:26
pjfanning added a commit that referenced this pull request Nov 21, 2026
The javadoc-commented TEXT_JAVASCRIPT constant needs blank lines around
it, which fails javafmtCheck on main since #1526.
@pjfanning pjfanning added this to the 2.1.0 milestone Nov 26, 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