Skip to content

Commit 59139ba

Browse files
afprtclrabparticular
authored andcommitted
Merge pull request #5140 from Particular/feature/changing-content-type-fallback
Changing fallback for content type to text/plain (cherry picked from commit 19354fc)
1 parent 8983a3f commit 59139ba

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/ServiceControl.Audit.Persistence.RavenDB/UnitOfWork/RavenAuditIngestionUnitOfWork.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public async Task RecordProcessedMessage(ProcessedMessage processedMessage, Read
3535
if (!body.IsEmpty)
3636
{
3737
await using var stream = new ReadOnlyStream(body);
38-
var contentType = processedMessage.Headers.GetValueOrDefault(Headers.ContentType, "text/xml");
38+
var contentType = processedMessage.Headers.GetValueOrDefault(Headers.ContentType, "text/plain");
3939

4040
await bodyStorage.Store(processedMessage.Id, contentType, body.Length, stream, cancellationToken);
4141
}

src/ServiceControl.Audit.Persistence.Tests/AuditTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ await IngestProcessedMessagesAudits(
8080
[Test]
8181
public async Task Can_roundtrip_message_body()
8282
{
83-
string expectedContentType = "text/xml";
83+
string expectedContentType = "text/plain";
8484
var unitOfWork = await StartAuditUnitOfWork(1);
8585

8686
var body = new byte[100];

src/ServiceControl.Audit.Persistence/BodyStorageEnricher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async ValueTask StoreAuditMessageBody(ReadOnlyMemory<byte> body, Processe
2121
return;
2222
}
2323

24-
var contentType = GetContentType(processedMessage.Headers, "text/xml");
24+
var contentType = GetContentType(processedMessage.Headers, "text/plain");
2525
processedMessage.MessageMetadata.Add("ContentType", contentType);
2626

2727
var stored = await TryStoreBody(body, processedMessage, bodySize, contentType, cancellationToken);

src/ServiceControl.Audit.UnitTests/BodyStorage/BodyStorageEnricherTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task Should_store_body_in_metadata_when_below_large_object_heap_and
9292
[Headers.MessageId] = "someid",
9393
["ServiceControl.Retry.UniqueMessageId"] = "someid",
9494
[Headers.ProcessingEndpoint] = "someendpoint",
95-
[Headers.ContentType] = "text/xml"
95+
[Headers.ContentType] = "text/plain"
9696
};
9797

9898
var message = new ProcessedMessage(headers, metadata);

src/ServiceControl.Persistence.RavenDB/UnitOfWork/RavenRecoverabilityIngestionUnitOfWork.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public Task RecordFailedProcessingAttempt(
3333
List<FailedMessage.FailureGroup> groups)
3434
{
3535
var uniqueMessageId = context.Headers.UniqueId();
36-
var contentType = GetContentType(context.Headers, "text/xml");
36+
var contentType = GetContentType(context.Headers, "text/plain");
3737
var bodySize = context.Body.Length;
3838

3939
processingAttempt.MessageMetadata.Add("ContentType", contentType);

0 commit comments

Comments
 (0)