Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support Access-Control-Expose-Headers #2550

Closed
hinok opened this issue Jan 11, 2015 · 4 comments
Closed

Feature request: Support Access-Control-Expose-Headers #2550

hinok opened this issue Jan 11, 2015 · 4 comments

Comments

@hinok
Copy link

hinok commented Jan 11, 2015

It would be great if we could define custom headers that browsers are allowed to access in config/cors.js
It's all about Access-Control-Expose-Headers.

I forked and added very basic implementation.
If you want I can make PR.

config/cors.js looks now

module.exports.cors = {

  // Stripped code for readability

  /***************************************************************************
  *                                                                          *
  * Which headers should be allowed for CORS requests? This is only used in  *
  * response to preflight requests.                                          *
  *                                                                          *
  ***************************************************************************/

  headers: 'content-type, Total-Count',

  /***************************************************************************
  *                                                                          *
  * Which headers in CORS response should be allowed for borwser? This is    *
  * only used in response to preflight requests.                             *
  *                                                                          *
  ***************************************************************************/

  exposeHeaders: 'Total-Count'

};

My solution: hinok@81ed85e

@gaprl mentioned that earlier: #2146

@loicsaintroch
Copy link
Contributor

I like your idea @hinok. We would love you to write a pull request of course! Thank you for helping us making Sails a better framework.

@aantipov
Copy link

+1

@artworkad
Copy link
Contributor

@loicsaintroch #2712

@hinok
Copy link
Author

hinok commented Mar 18, 2015

@artworkad Good, I didn't have time to write tests for that feature but I'm glad that someone made PR ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants