type ChangesRequestSchemeBasedOnXForwardedProto(next : RequestDelegate) = member this.Invoke(context : HttpContext) = let xForwardedProto = context.Request.Headers.["X-Forwarded-Proto"] if xForwardedProto = (StringValues "https") then context.Request.Scheme <- "https" else () next.Invoke(context)