Skip to content

Instantly share code, notes, and snippets.

@aaronmu
Created February 13, 2020 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronmu/22bd671b9dd9e24502af4baca62b7827 to your computer and use it in GitHub Desktop.
Save aaronmu/22bd671b9dd9e24502af4baca62b7827 to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment