Sorry to reopen this thread a lot later, but I just saw it and wanted to set the record straight:
Custom headers only apply to files we serve from our own backing store.
If we proxy to a different service, we do not add any headers EXCEPT a few administrative ones - we do not intend to let you add your own headers to what gets returned to the browser. While I realize this isn’t what you were hoping for, the intention is that you’d set those headers yourself on the REMOTE service. I understand that’s not always possible, but that’s how the feature was designed.
Thanks again for talking through this and we will try to make this clearer in the docs!
Netlify Proxy isn’t the right place to set it. You should have it set in the browser, and the browser should send it along with the request. Netlify doesn’t make our own requests to your proxy’d URL - they always come from a browser. So that’s the right path to follow