diff --git a/messaging.tests/Integration/BundlesControllerTests.cs b/messaging.tests/Integration/BundlesControllerTests.cs index 533fb39..a61acca 100644 --- a/messaging.tests/Integration/BundlesControllerTests.cs +++ b/messaging.tests/Integration/BundlesControllerTests.cs @@ -557,6 +557,23 @@ public async void PostNCHSIsInDestinationEndpointList() Assert.Equal(HttpStatusCode.NoContent, createSubmissionMessage.StatusCode); } + [Fact] + public async void PostNCHSIsInDestinationEndpointListUppercase() + { + // Clear any messages in the database for a clean test + DatabaseHelper.ResetDatabase(_context); + + // Create a new empty Death Record WITH nchs in the endpoint list + DeathRecordSubmissionMessage recordSubmission = new DeathRecordSubmissionMessage(new DeathRecord()); + recordSubmission.JurisdictionId = "MA"; + recordSubmission.MessageSource = "http://example.fhir.org"; + recordSubmission.CertNo = 1; + recordSubmission.MessageDestination = "temp,http://nchs.CDC.gov/VRDR_Submission,temp"; + // Submit that Death Record + HttpResponseMessage createSubmissionMessage = await JsonResponseHelpers.PostJsonAsync(_client, $"/MA/Bundle", recordSubmission.ToJson()); + Assert.Equal(HttpStatusCode.NoContent, createSubmissionMessage.StatusCode); + } + [Fact] public async void PostCatchMissingId() { diff --git a/messaging/Controllers/BundlesController.cs b/messaging/Controllers/BundlesController.cs index 79ab094..d29b7c0 100644 --- a/messaging/Controllers/BundlesController.cs +++ b/messaging/Controllers/BundlesController.cs @@ -494,7 +494,8 @@ private bool validateNCHSDestination(string destination) List destinationEndpoints = destination.Split(',').ToList(); foreach (string d in destinationEndpoints) { - switch (d) + // set the message destination to lowercase to make the url validation case-insensitive + switch (d.ToLower()) { case "http://nchs.cdc.gov/vrdr_acknowledgement": case "http://nchs.cdc.gov/vrdr_alias":