Skip to content

Commit

Permalink
solve #32 and #31
Browse files Browse the repository at this point in the history
  • Loading branch information
64J0 committed Jan 27, 2025
1 parent 82c9b53 commit f841459
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Giraffe/RequestLimitation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let mustAcceptAny (mimeTypes: string list) (optionalErrorHandler: OptionalErrorH
)

match Option.ofObj (headers.Accept :> _ seq) with
| Some xs when Seq.map (_.ToString()) xs |> Seq.exists (fun x -> Seq.contains x mimeTypes) -> next ctx
| Some xs when Seq.map (_.ToString()) xs |> Seq.exists (fun x -> List.contains x mimeTypes) -> next ctx
| Some xs when Seq.isEmpty xs -> headerNotFoundHandler earlyReturn ctx
| Some _ -> invalidHeaderValueHandler earlyReturn ctx
| None -> headerNotFoundHandler earlyReturn ctx
Expand Down Expand Up @@ -75,7 +75,7 @@ let hasAnyContentTypes (contentTypes: string list) (optionalErrorHandler: Option
)

match Option.ofObj ctx.Request.ContentType with
| Some header when Seq.contains header contentTypes -> next ctx
| Some header when List.contains header contentTypes -> next ctx
| Some header when String.IsNullOrEmpty header -> headerNotFoundHandler earlyReturn ctx
| Some _ -> invalidHeaderValueHandler earlyReturn ctx
| None -> headerNotFoundHandler earlyReturn ctx
Expand Down

0 comments on commit f841459

Please sign in to comment.