Skip to content

Commit

Permalink
FIX mutator propagation, added Web config options (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbotinelly authored Jul 13, 2023
1 parent eca9643 commit d36cf60
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Zen.Base/Module/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ public T Save(Mutator mutator = null)
else BeforeUpdate();
BeforeSave();

var postKey = Info<T>.Settings.Adapter.Upsert(localModel).GetDataKey();
var postKey = Info<T>.Settings.Adapter.Upsert(localModel, mutator).GetDataKey();

Info<T>.TryFlushCachedModel(localModel);

Expand Down
1 change: 0 additions & 1 deletion Zen.Web.App/Zen.Web.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<ProjectReference Include="..\Zen.Media\Zen.Media.csproj" />
<ProjectReference Include="..\Zen.Storage\Zen.Storage.csproj" />
<ProjectReference Include="..\Zen.Web.Auth\Zen.Web.Auth.csproj" />
<ProjectReference Include="..\Zen.Web.GraphQL\Zen.Web.GraphQL.csproj" />
<ProjectReference Include="..\Zen.Web\Zen.Web.csproj" />
</ItemGroup>

Expand Down
14 changes: 12 additions & 2 deletions Zen.Web/Service/Extensions/Use.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,20 @@ public static void UseZenWeb(this IApplicationBuilder app, Action<IZenWebBuilder
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();

if (options.Hsts)
{
app.UseHsts();
Events.AddLog("HSTS", "enabled");
}
}

if (!Base.Host.IsContainer) app.UseHttpsRedirection();
if (!Base.Host.IsContainer)
if (options.HttpsRedirection)
{
app.UseHttpsRedirection();
Events.AddLog("HTTPS Redirection", "enabled");
}

configuration?.Invoke(builder);
}
Expand Down
2 changes: 2 additions & 0 deletions Zen.Web/Service/ZenWebOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ public PathString DefaultPage
public string SourcePath { get; set; }
public bool UseHtml5 { get; set; }
public bool UseSpa { get; set; } = true;
public bool Hsts { get; set; } = true;
public bool HttpsRedirection { get; set; } = true;
}
}

0 comments on commit d36cf60

Please sign in to comment.