Netlify function basic auth cors


I have a netlify function setup with basic auth and cors headers. I am trying to have another webpage call this function. When running locally on different ports, it works. When deployed, get auth and cors errors. In my netlify.toml, setup basic auth, and in both the toml and functions have headers Access-Control-Allow-Origin, Access-Control-Allow-Credentials, Access-Control-Allow-Headers, Access-Control-Allow-Methods. Any help would be appreciated, thanks!

You cannot use our normal custom headers directly on functions, Jordan. Your headers will NOT apply to anything in the path /.netlify/* which are handled via a different system.

On the other hand, you should be able to send HTTP headers as output from the function itself. Not clear which way you’re doing it, so more information would be useful to help you out.