Tags: avidal/fastlike
Tags
Switch backends from RoundTrippers to Handlers Originally, this project used http.Handler for the backend type, but I switched to http.RoundTripper because I thought the general use-case would be sending fastlike subrequests to another process. While I still believe that to be generally true, having backends be Handlers is simpler for embedders that want to respond in-process, and it's very easy to create a reverse proxy to send requests upstream that still implements the `Handler` interface.
Now with TLS support! (kind of) With the addition of `SecureRequestOption` embedders can control whether a downstream request should be considered "secure", and have the scheme set to https and the `fastly-ssl` header set. By default, a request is considered secure if it has a non-nil `TLS` property, which is set by `net/http` when accepting a request over a TLS server and before calling a handler. An embedder may choose to also consider a request secure if it comes from an upstream proxy that terminates TLS, in which case the secure option func may return true if the request has an `x-forwarded-proto` header of `https`