Skip to content

feat(netty-codec-http): more standard http content types - #16036

Merged
normanmaurer merged 3 commits into
netty:4.2from
ultraviolet-jordan:feat/http-content-types2
Jan 9, 2026
Merged

normanmaurer merged 3 commits into
netty:4.2from
ultraviolet-jordan:feat/http-content-types2

Conversation

@ultraviolet-jordan

Copy link
Copy Markdown
Contributor

Motivation:

To add more standard http content type values.
For reference: https://www.iana.org/assignments/media-types/media-types.xhtml

For example, Netty defines text/css and text/html but not text/javascript.

Modification:

Add new constants to HttpHeaderValues defining more standard http content types.
I moved APPLICATION_X_WWW_FORM_URLENCODED down a few lines to be alphabetical.

Result:

New constants to HttpHeaderValues defining more standard http content types.


Please cherry pick into 4.1 and 5.0.
Thank you!

@normanmaurer

Copy link
Copy Markdown
Member

@normanmaurer normanmaurer added this to the 4.2.10.Final milestone Dec 16, 2025
@ultraviolet-jordan

Copy link
Copy Markdown
Contributor Author

@ultraviolet-jordan have you signed our ICLA ? https://netty.io/s/icla

I hadn't but it is signed now. Thanks for catching that.

@normanmaurer
normanmaurer merged commit f7b7fa2 into netty:4.2 Jan 9, 2026
@normanmaurer

Copy link
Copy Markdown
Member

@ultraviolet-jordan thanks!

normanmaurer added a commit that referenced this pull request Jan 9, 2026
Motivation:

To add more standard http content type values. 
For reference:
https://www.iana.org/assignments/media-types/media-types.xhtml

For example, Netty defines `text/css` and `text/html` but not
`text/javascript`.

Modification:

Add new constants to `HttpHeaderValues` defining more standard http
content types.
I moved `APPLICATION_X_WWW_FORM_URLENCODED` down a few lines to be
alphabetical.

Result:

New constants to `HttpHeaderValues` defining more standard http content
types.

----

Please cherry pick into 4.1 and 5.0.
Thank you!

Co-authored-by: Norman Maurer <[email protected]>
normanmaurer added a commit that referenced this pull request Jan 9, 2026
Motivation:

To add more standard http content type values. 
For reference:
https://www.iana.org/assignments/media-types/media-types.xhtml

For example, Netty defines `text/css` and `text/html` but not
`text/javascript`.

Modification:

Add new constants to `HttpHeaderValues` defining more standard http
content types.
I moved `APPLICATION_X_WWW_FORM_URLENCODED` down a few lines to be
alphabetical.

Result:

New constants to `HttpHeaderValues` defining more standard http content
types.

----

Please cherry pick into 4.1 and 5.0.
Thank you!

Co-authored-by: Norman Maurer <[email protected]>
normanmaurer added a commit that referenced this pull request Jan 9, 2026
…6121)

Motivation:

To add more standard http content type values. 
For reference:
https://www.iana.org/assignments/media-types/media-types.xhtml

For example, Netty defines `text/css` and `text/html` but not
`text/javascript`.

Modification:

Add new constants to `HttpHeaderValues` defining more standard http
content types.
I moved `APPLICATION_X_WWW_FORM_URLENCODED` down a few lines to be
alphabetical.

Result:

New constants to `HttpHeaderValues` defining more standard http content
types.

----

Please cherry pick into 4.1 and 5.0.
Thank you!

Co-authored-by: Norman Maurer <[email protected]>

Co-authored-by: Jordan <[email protected]>
normanmaurer added a commit that referenced this pull request Jan 9, 2026
…6122)

Motivation:

To add more standard http content type values. 
For reference:
https://www.iana.org/assignments/media-types/media-types.xhtml

For example, Netty defines `text/css` and `text/html` but not
`text/javascript`.

Modification:

Add new constants to `HttpHeaderValues` defining more standard http
content types.
I moved `APPLICATION_X_WWW_FORM_URLENCODED` down a few lines to be
alphabetical.

Result:

New constants to `HttpHeaderValues` defining more standard http content
types.

----

Please cherry pick into 4.1 and 5.0.
Thank you!

Co-authored-by: Norman Maurer <[email protected]>

Co-authored-by: Jordan <[email protected]>
@normanmaurer normanmaurer mentioned this pull request Sep 22, 2026
@normanmaurer normanmaurer mentioned this pull request Oct 1, 2026
He-Pin added a commit to apache/pekko-http that referenced this pull request Nov 17, 2026
Motivation:
Default file serving needs registered binary media types.

Modification:
Register application/wasm and image/avif with Scala and Java constants, extension mappings and regression coverage.

Result:
The formats resolve to the appropriate binary types with their correct compression flags.

Validation:
The owner reports CI passed for this PR. No additional CI inspection or local test run was performed during merge.

References:
netty/netty#16036
He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 20, 2026
Motivation:
RFC 9239 identifies text/javascript as the preferred media type for
JavaScript, but the default filename lookup chooses application/javascript.

Modification:
Register text/javascript for .js and .mjs in the Scala and Java models.
Keep application/javascript available for explicit use and parsing.
Update the documentation and cover plain and precompressed file lookup.

Result:
Default file serving uses the preferred media type, with the existing
charset and precompression handling. Explicit legacy media types remain
supported.

References:
https://www.rfc-editor.org/rfc/rfc9239.html#section-6.1.1
netty/netty#16036
He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 20, 2026
Motivation:
Web app manifests have the registered application/manifest+json media type
and .webmanifest extension, but the default registry does not recognize them.

Modification:
Add fixed-UTF-8 Scala and Java media type constants and the exact extension
mapping. Cover typed parsing, extension lookup, Java use, and the file
resolver's independence from the default text charset. Document the mapping.

Result:
Web manifests resolve to application/manifest+json without a charset
parameter. Existing .json and .manifest mappings remain unchanged.

Tests:
- Offline Scala 2.13.18 and Java focused compilation passed.
- HeaderSpec selected test: 1 passed with current header parser overlay.
- Java positive test method and four extracted resolver cases passed.
- Exact main registry assertion failed before and passed after this change.
- Cached scalafmt 3.11.5 and Java formatter 1.28.0 applied; diff check passed.
- Public javap comparison: only new manifest getters and Java constant.
- Full routing suite, sbt checks, MiMa, Scala 3 and CI not run; cached route
  testkit artifacts unavailable. Unchanged parser compile has an existing
  non-exhaustive-match warning.

References:
https://www.iana.org/assignments/media-types/application/manifest+json
https://www.rfc-editor.org/rfc/rfc8259#section-8.1
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:
Web app manifests have the registered application/manifest+json media type
and .webmanifest extension, but the default registry does not recognize them.

Modification:
Add fixed-UTF-8 Scala and Java media type constants and the exact extension
mapping. Cover typed parsing, extension lookup, Java use, and the file
resolver's independence from the default text charset. Document the mapping.
Use explicit nested foreach blocks for the two resolver test dimensions,
so the filename is scoped consistently across Scala versions.

Result:
Web manifests resolve to application/manifest+json without a charset
parameter. Existing .json and .manifest mappings remain unchanged.

Tests:
- Prior revision passed the Scala 2.13 CI job; Scala 3 and next failed to
  compile the new resolver test with an out-of-scope filename.
- The revised test body was compiled and run for all four resolver cases
  offline on Scala 2.13.18; Scalafmt and git diff --check passed.
- Scala 3 and next have not been rerun on this revision.

References:
https://www.iana.org/assignments/media-types/application/manifest+json
https://www.rfc-editor.org/rfc/rfc8259#section-8.1
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 added a commit to apache/pekko-http that referenced this pull request Nov 20, 2026
Motivation:
RFC 9239 identifies text/javascript as the preferred media type for
JavaScript, but the default filename lookup chooses application/javascript.

Modification:
Register text/javascript for .js and .mjs in the Scala and Java models.
Keep application/javascript available for explicit use and parsing.
Update the documentation and cover plain and precompressed file lookup.

Result:
Default file serving uses the preferred media type, with the existing
charset and precompression handling. Explicit legacy media types remain
supported.

References:
https://www.rfc-editor.org/rfc/rfc9239.html#section-6.1.1
netty/netty#16036
He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 20, 2026
Motivation:
Web app manifests have the registered application/manifest+json media type
and .webmanifest extension, but the default registry does not recognize them.

Modification:
Add fixed-UTF-8 Scala and Java media type constants and the exact extension
mapping. Cover typed parsing, extension lookup, Java use, and the file
resolver's independence from the default text charset. Document the mapping.
Use explicit nested foreach blocks for the two resolver test dimensions,
so the filename is scoped consistently across Scala versions.

Result:
Web manifests resolve to application/manifest+json without a charset
parameter. Existing .json and .manifest mappings remain unchanged.

Tests:
- Prior revision passed the Scala 2.13 CI job; Scala 3 and next failed to
  compile the new resolver test with an out-of-scope filename.
- The revised test body was compiled and run for all four resolver cases
  offline on Scala 2.13.18; Scalafmt and git diff --check passed.
- Scala 3 and next have not been rerun on this revision.

References:
https://www.iana.org/assignments/media-types/application/manifest+json
https://www.rfc-editor.org/rfc/rfc8259#section-8.1
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 added a commit to apache/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 #1524.
https://www.iana.org/assignments/media-types/audio/aac
netty/netty#16036 (independent implementation)
He-Pin added a commit to apache/pekko-http that referenced this pull request Nov 20, 2026
Motivation:
Web app manifests have the registered application/manifest+json media type
and .webmanifest extension, but the default registry does not recognize them.

Modification:
Add fixed-UTF-8 Scala and Java media type constants and the exact extension
mapping. Cover typed parsing, extension lookup, Java use, and the file
resolver's independence from the default text charset. Document the mapping.
Use explicit nested foreach blocks for the two resolver test dimensions,
so the filename is scoped consistently across Scala versions.

Result:
Web manifests resolve to application/manifest+json without a charset
parameter. Existing .json and .manifest mappings remain unchanged.

Tests:
- Prior revision passed the Scala 2.13 CI job; Scala 3 and next failed to
  compile the new resolver test with an out-of-scope filename.
- The revised test body was compiled and run for all four resolver cases
  offline on Scala 2.13.18; Scalafmt and git diff --check passed.
- Scala 3 and next have not been rerun on this revision.

References:
https://www.iana.org/assignments/media-types/application/manifest+json
https://www.rfc-editor.org/rfc/rfc8259#section-8.1
netty/netty#16036 (independent implementation)
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