Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Http/Wolverine.Http/HttpChain.EndpointBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Diagnostics;
using System.Reflection;
using JasperFx.CodeGeneration;
using JasperFx.Core;
Expand All @@ -9,7 +8,6 @@
using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.FSharp.Core;
using Wolverine.Http.Resources;

namespace Wolverine.Http;
Expand Down Expand Up @@ -131,7 +129,7 @@ private void establishResourceTypeMetadata(RouteEndpointBuilder builder)
{
if (tryApplyAsEndpointMetadataProvider(ResourceType, builder)) return;

if (ResourceType == null || ResourceType == typeof(void) || ResourceType == typeof(Unit))
if (ResourceType == null || ResourceType == typeof(void) || ResourceType.FullName == "Microsoft.FSharp.Core.Unit")
{
Metadata.Produces(204);
return;
Expand Down
3 changes: 1 addition & 2 deletions src/Http/Wolverine.Http/HttpChain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Patterns;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.FSharp.Core;
using Wolverine.Configuration;
using Wolverine.Http.CodeGen;
using Wolverine.Http.Metadata;
Expand Down Expand Up @@ -263,7 +262,7 @@ public static HttpChain ChainFor(Type handlerType, string methodName, HttpGraph?

public bool HasResourceType()
{
return ResourceType != null && ResourceType != typeof(void) && ResourceType != typeof(Unit);
return ResourceType != null && ResourceType != typeof(void) && ResourceType.FullName != "Microsoft.FSharp.Core.Unit";
}

public override bool ShouldFlushOutgoingMessages()
Expand Down
3 changes: 1 addition & 2 deletions src/Http/Wolverine.Http/Resources/EmptyBody204Policy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
using JasperFx.CodeGeneration.Frames;
using JasperFx.CodeGeneration.Model;
using Microsoft.AspNetCore.Http;
using Microsoft.FSharp.Core;

namespace Wolverine.Http.Resources;

internal class EmptyBody204Policy : IResourceWriterPolicy
{
public bool TryApply(HttpChain chain)
{
if (chain.ResourceType == null || chain.ResourceType == typeof(void) || chain.ResourceType == typeof(Unit))
if (chain.ResourceType == null || chain.ResourceType == typeof(void) || chain.ResourceType.FullName == "Microsoft.FSharp.Core.Unit")
{
chain.Postprocessors.Insert(0, new WriteEmptyBodyStatusCode());
chain.Metadata.Produces(204);
Expand Down
5 changes: 0 additions & 5 deletions src/Http/Wolverine.Http/Wolverine.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
<ProjectReference Include="..\..\Wolverine\Wolverine.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FSharp.Core" Version="9.0.303" />
</ItemGroup>

</Project>
Loading