I would like to propose an enhancement to the fal.config method where a requestMiddleware function can be further configured. Currently, the requestConfig object only exposes the headers and URL information. However, it would be beneficial if the requestConfig also exposed the HTTP request method.
Use Case:
In our use case, we need to supply an API auth token to the FAL proxy server through the middleware. Here’s a basic example of how we configure the client:
This middleware adds authentication tokens to the request headers. However, to enhance security, it would be ideal to omit sending tokens in GET requests, lowering exposure.
Proposed Enhancement:
Consider exposing the request method in the requestConfig object passed to the requestMiddleware. This additional information would allow developers to conditionally include or exclude sensitive headers based on the request method, reducing the risk of exposing secrets in scenarios where they are not needed.
Description:
I would like to propose an enhancement to the
fal.config
method where arequestMiddleware
function can be further configured. Currently, therequestConfig
object only exposes the headers and URL information. However, it would be beneficial if therequestConfig
also exposed the HTTP request method.Use Case:
In our use case, we need to supply an API auth token to the FAL proxy server through the middleware. Here’s a basic example of how we configure the client:
This middleware adds authentication tokens to the request headers. However, to enhance security, it would be ideal to omit sending tokens in GET requests, lowering exposure.
Proposed Enhancement:
Consider exposing the request method in the
requestConfig
object passed to therequestMiddleware
. This additional information would allow developers to conditionally include or exclude sensitive headers based on the request method, reducing the risk of exposing secrets in scenarios where they are not needed.Example Usage: