Skip to content

Commit

Permalink
ProfilesModule Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
semalaiappan committed Jan 29, 2025
1 parent 85a3532 commit e65c587
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ namespace EdFi.Ods.Features.Container.Modules
{
public class ProfilesModule : ConditionalModule
{
private readonly ApiSettings _apiSettings;

public ProfilesModule(ApiSettings apiSettings)
: base(apiSettings, nameof(ProfilesModule)) { }
: base(apiSettings, nameof(ProfilesModule))
{
_apiSettings = apiSettings;
}

public override bool IsSelected() => IsFeatureEnabled(ApiFeature.Profiles);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class ProfileContentTypeContextMiddleware
"The profile usage segment in the profile-based '{0}' header was not recognized.";
private const string NonExistingProfileFormat =
"The profile specified by the content type in the '{0}' header is not supported by this host.";
private const string MisconfiguredProfileFormat =
"The profile specified by the content type in the '{0}' header is configured but invalid.";

private const int ResourceNameFacet = 0;
private const int ProfileNameFacet = 1;
Expand Down Expand Up @@ -163,11 +165,11 @@ await WriteResponse(

if (_profileMetadataProvider.GetValidationResults().Any(x => x.Name.Equals(profileName, StringComparison.OrdinalIgnoreCase)))
{
await WriteResponseUsingFormat(
await WriteResponse(
response,
StatusCodes.Status406NotAcceptable,
headerName,
LogMessageFormatType.MisconfiguredProfileFormat);
MisconfiguredProfileFormat);

return (false, null);
}
Expand Down

0 comments on commit e65c587

Please sign in to comment.