garmeeh / local-cors-proxy

Simple proxy to bypass CORS issues.
MIT License
328 stars 81 forks source link

✨ Add exposedHeaders CORS option #37

Open BasilVictor opened 1 year ago

BasilVictor commented 1 year ago

When using API endpoints that send information via the response headers, we are not able to access them even though it is recived.

Example

When using a download file API endpoint, the file name was being sent in the Content-Disposition header. When trying to access this information from JavaScript it as returning undefined.

Solution

Thus I have added an --exposedHeaders option which accepts a comma seperated list such as: [Content-Disposition,Date] OR [*] whcih then gives JavaScript client access to the headers.

Thank you for this project 🙏