Skip to content

feat: register the AAC audio media type - #1524

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:feat/aac-media-type
Nov 20, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:feat/aac-media-type

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Motivation

The registered audio/aac media type and its .aac and .loas filename mappings
are missing from the built-in registry.

Modification

Add binary, non-compressible Scala and Java constants and the two extension
mappings. Cover registry lookup, parsing, Java use and file resolver behavior.
Document the default mapping while retaining existing audio types.

Result

ADTS .aac and LATM/LOAS .loas files resolve to audio/aac without a charset.
No MP4 mapping, content inspection or audio decoding is introduced.
Additional registered aliases are outside this change's scope.

Tests

  • Focused Scala 2.13.18 compilation with the current parser and four selected Scala cases passed.
  • A direct Java test method, eight isolated AAC file resolver cases and an unchanged MP3 control passed.
  • The registry assertion fails against the exact baseline and passes with the candidate.
  • Full routing, sbt, MiMa and Scala 3 validation were not run locally.

GitHub Actions passed on this exact head: Validate and test, Headers, Scalafmt. Validate and test passed for Scala 2.13, Scala 3, next, and Checks.

References

https://www.iana.org/assignments/media-types/audio/aac
netty/netty#16036 (independent implementation)

He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 20, 2026
Motivation:
The default registry does not recognize the registered audio/aac media
type or its .aac and .loas filename extensions.

Modification:
Register binary, non-compressible audio/aac for .aac and .loas, expose
Scala and Java constants, and document and test the default mapping.
Use explicit nested iteration in the resolver test so both loop
bindings are in scope on Scala 3.

Result:
ADTS .aac and LATM/LOAS .loas files resolve to audio/aac without a
charset parameter. Existing audio mappings are unchanged.

Tests:
- The prior PR head passed Scala 2.13, Checks, Headers, and Scalafmt in
  GitHub Actions. Both Scala 3 lanes failed compiling the resolver test
  with 'Not found: filename'; this revision changes only that test.
- Isolated Scala 2.13.18 compilation with -Werror and one extracted
  ScalaTest resolver case passed (eight filename/charset combinations).
- Cached Scalafmt 3.11.5 and git diff --check passed.
- Full sbt and Scala 3 were not rerun locally; CI pending for this revision.

References:
Refs apache#1524.
https://www.iana.org/assignments/media-types/audio/aac
netty/netty#16036 (independent implementation)
@He-Pin
He-Pin force-pushed the feat/aac-media-type branch from 663e57b to 230676e Compare November 20, 2026 06:35
@He-Pin
He-Pin marked this pull request as ready for review November 20, 2026 06:56
Motivation:
The default registry does not recognize the registered audio/aac media
type or its .aac and .loas filename extensions.

Modification:
Register binary, non-compressible audio/aac for .aac and .loas, expose
Scala and Java constants, and document and test the default mapping.
Use explicit nested iteration in the resolver test so both loop
bindings are in scope on Scala 3.

Result:
ADTS .aac and LATM/LOAS .loas files resolve to audio/aac without a
charset parameter. Existing audio mappings are unchanged.

Tests:
- The prior PR head passed Scala 2.13, Checks, Headers, and Scalafmt in
  GitHub Actions. Both Scala 3 lanes failed compiling the resolver test
  with 'Not found: filename'; this revision changes only that test.
- Isolated Scala 2.13.18 compilation with -Werror and one extracted
  ScalaTest resolver case passed (eight filename/charset combinations).
- Cached Scalafmt 3.11.5 and git diff --check passed.
- Full sbt and Scala 3 were not rerun locally; CI pending for this revision.

References:
Refs apache#1524.
https://www.iana.org/assignments/media-types/audio/aac
netty/netty#16036 (independent implementation)
@He-Pin
He-Pin force-pushed the feat/aac-media-type branch from 230676e to a058d85 Compare November 20, 2026 14:34
@He-Pin He-Pin added this to the 2.1.0 milestone Nov 20, 2026
@He-Pin
He-Pin merged commit d9ae2d2 into apache:main Nov 20, 2026
6 checks passed
@He-Pin
He-Pin deleted the feat/aac-media-type branch November 20, 2026 15:01
pjfanning added a commit that referenced this pull request Nov 21, 2026
Motivation:
The text/javascript, application/manifest+json and audio/aac changes
(#1522, #1523, #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 #1522, #1523, #1524
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