Skip to content

Commit b1affea

Browse files
Fix set_body overload (#59)
1 parent 16f9649 commit b1affea

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Saturn/Pipelines.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ module Pipeline =
4444
[<CustomOperation("requires_policy")>]
4545
member __.RequiresPolicy(state, policy:string, authFailedHandler) : HttpHandler =
4646
state >=>
47-
fun (next : HttpFunc) (ctx : HttpContext) ->
47+
fun (next : HttpFunc) (ctx : HttpContext) ->
4848
match ctx.GetService<IAuthorizationService>() with
49-
| null ->
49+
| null ->
5050
authFailedHandler (Some >> Task.FromResult) ctx
51-
| authService -> task {
51+
| authService -> task {
5252
let! authResult = authService.AuthorizeAsync (ctx.User, policy)
5353
if authResult.Succeeded then
5454
return! next ctx
5555
else
5656
return! authFailedHandler (Some >> Task.FromResult) ctx
5757
}
58-
58+
5959
///`requires_authentication` validates if a user is authenticated/logged in. If the user is not authenticated then the handler will execute the `authFailedHandler` function.
6060
[<CustomOperation("requires_authentication")>]
6161
member __.RequiresAuthentication (state, authFailedHandler) : HttpHandler = state >=> (requiresAuthentication authFailedHandler)
@@ -84,9 +84,9 @@ module Pipeline =
8484
[<CustomOperation("set_body")>]
8585
member __.SetBody(state, value) : HttpHandler = state >=> (setBody value)
8686

87-
///`set_body` sets or modifies the body of the `HttpResponse`. This http handler triggers a response to the client and other http handlers will not be able to modify the HTTP headers afterwards any more.
88-
[<CustomOperation("set_body")>]
89-
member __.SetBody(state, value) : HttpHandler = state >=> (setBodyFromString value)
87+
///`set_body_from_string` sets or modifies the body of the `HttpResponse`. This http handler triggers a response to the client and other http handlers will not be able to modify the HTTP headers afterwards any more.
88+
[<CustomOperation("set_body_from_string")>]
89+
member __.SetBodyFromString(state, value) : HttpHandler = state >=> (setBodyFromString value)
9090

9191
///`text` sets or modifies the body of the `HttpResponse` by sending a plain text value to the client. This http handler triggers a response to the client and other http handlers will not be able to modify the HTTP headers afterwards any more. It also sets the `Content-Type` HTTP header to `text/plain`.
9292
[<CustomOperation("text")>]

0 commit comments

Comments
 (0)