Skip to content

Fallback to application/octet-stream content type when for invalid UTF-8 message bodies so ServicePulse will not fail loading the BLOB#5394

Open
ramonsmits wants to merge 2 commits intomasterfrom
fix-binary-body-content-type
Open

Fallback to application/octet-stream content type when for invalid UTF-8 message bodies so ServicePulse will not fail loading the BLOB#5394
ramonsmits wants to merge 2 commits intomasterfrom
fix-binary-body-content-type

Conversation

@ramonsmits
Copy link
Member

@ramonsmits ramonsmits commented Mar 20, 2026

Summary

  • When a message body claims to be text (via content type header) but contains invalid UTF-8 bytes, the DecoderFallbackException handler now updates MessageMetadata["ContentType"] to application/octet-stream and falls back to body storage
  • Only ServiceControl's stored metadata is affected, the original NServiceBus message header is never modified

Impact on ServicePulse

  1. contentTypeParser.ts : application/octet-stream falls into the application/ branch but doesn't match +json or +xml, so it returns { isSupported: false }.
  2. BodyView.vue will show : "Message body cannot be displayed because content type application/octet-stream is not supported." This is an improvement over the current behavior where ServicePulse tries to parse binary data as JSON/XML and crashes.
  3. MessageStore.ts : the JSON/XML formatting try block won't trigger for application/octet-stream, so no parse errors.
  4. EditRetryDialog.vue : edit & retry will be disabled with a warning that the content type is not supported. Correct behavior for binary data.

…data

When a message body fails UTF-8 decoding despite the content type header
claiming text, update the metadata content type to application/octet-stream
and fall back to body storage instead of silently dropping the body.
@ramonsmits ramonsmits changed the title Fix content type metadata for invalid UTF-8 message bodies Fallback to application/octet-stream content type when for invalid UTF-8 message bodies so ServicePulse will not fail loading the BLOB Mar 20, 2026
When a failed message body is not valid UTF-8 despite the content type
header, update metadata and attachment content type to
application/octet-stream. Replay is unaffected as it uses the original
message headers, not metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants