Skip to content

Commit

Permalink
More robust workaround for Giraffe bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeeren committed Jun 8, 2020
1 parent d71f0b8 commit 15262c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ That’s it! You now have a wonderfully compliant JSON:API exposing your wonderf
Release notes
-------------

### 0.8.4 (2020-06-08)

* More robust workaround workaround for [giraffe-fsharp/Giraffe#24](https://github.com/giraffe-fsharp/Giraffe/issues/424)

### 0.8.3 (2020-06-05)

* Added workaround for [giraffe-fsharp/Giraffe#24](https://github.com/giraffe-fsharp/Giraffe/issues/424)
Expand Down
4 changes: 2 additions & 2 deletions src/Felicity/Felicity.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>f# fsharp jsonapi json-api json:api api rest rest-api api-rest api-server api-client web-api asp-net-core aspnetcore giraffe framework</PackageTags>
<PackageIcon>felicity-logo-128x128.png</PackageIcon>
<Version>0.8.3</Version>
<PackageReleaseNotes>Added workaround for Giraffe bug (https://github.com/giraffe-fsharp/Giraffe/issues/424)</PackageReleaseNotes>
<Version>0.8.4</Version>
<PackageReleaseNotes>More robust workaround for Giraffe bug (https://github.com/giraffe-fsharp/Giraffe/issues/424)</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Felicity/Operations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Preconditions<'ctx, 'entity> = internal {
let lastModified =
this.getLastModified ctx (unbox<'entity> entity)
// Workaround for https://github.com/giraffe-fsharp/Giraffe/issues/424
|> Option.map (fun dt -> dt.AddMilliseconds (float (-dt.Millisecond)))
|> Option.map (fun dt -> dt.AddTicks(-(dt.Ticks % TimeSpan.TicksPerSecond)))
let res = httpCtx.ValidatePreconditions eTag lastModified
// Clear headers because response-level ETag/Last-Modified headers don't
// necessarily make sense in JSON:API due to compound documents; these values
Expand Down

0 comments on commit 15262c3

Please sign in to comment.