Clever TaglineC
Convex Community16mo ago
7 replies
Clever Tagline

Using HTTP "Host" header to help validate requests

I'm building some HTTP endpoints for internal use and want to validate requests through them using a token. However, I want to use a different token for prod and dev Convex environments. In looking for a way to identify programmatically which environment is running the function, I noticed that the request's "Host" header matches the root HTTP endpoint URL; e.g. "perfect-ant-202.convex.site". Is it safe to compare against that to determine if the dev or prod URL was called? Is there a chance that this header will change in the future?
Was this page helpful?