SIGN IN SIGN UP

Detect HTML content type with existing parser

Use http_helpers::getContentType() when deciding whether to add
HTML-only security headers.

Previously this logic checked the raw Content-Type header with a
text/html prefix match. That worked for the values we emit today,
but it open-coded Content-Type handling in this path instead of using
the existing parser.

Switch this logic to getContentType() so it stays consistent with
the rest of the code and correctly handles valid variations such as
case-insensitive HTML MIME types.

Add unit coverage for getContentType() to verify HTML MIME types
with charset parameters and case-insensitive input.

Tested: unit tests passed.

Change-Id: I1cff40453ab4851cc7b24615a20fb6abcfba864b
Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com>
J
Joel Pullokaran Jesin committed
d7744feb85a79ebb9069a5a0c2afa6f56c6f9f4a
Parent: 509ced5
Committed by Ed Tanous <ed@tanous.net> on 7/16/2026, 5:21:50 PM