Custom response headers with Strongloop framework

BogdanBiv

Whenever my Chrome browser makes a request to the REST api server a browser error appears in console saying Refused to get unsafe header "Content-Range". Now I've managed to fix this in my vanilla express server (i.e. without StrongLoop) in two distinct ways:

Now how can I achieve this in my StrongLoop instance? Official SL documentation only talks about cors.origin and cors.credentials, see http://docs.strongloop.com/display/public/LB/config.json.

Have I missed anything?

UPDATE with the best solution:

// config.json
"cors": {
  "origin": true,
  "credentials": true,
  "allowedHeaders": ["X-Requested-With"],
  "exposedHeaders": ["Content-Range"]
},
Raymond Feng

We use node-cors behind the scene. The cors options configured in config.json will be passed to node-cors. Can you try that?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cannot set headers of an Iron framework Response

From Dev

How to access angular $http response custom headers?

From Dev

Reading Custom HTTP response headers in Angular 2

From Dev

Angular returns response without my custom headers

From Dev

Access-Control-Expose-Headers Configuration for Custom Response Headers AngularJS

From Dev

eve framework send custom response

From Dev

Aleph/Clojure - How to insert custom headers in the web socket upgrade response?

From Dev

Django Rest Framework custom response message

From Dev

Custom throttling response in django rest framework

From Dev

Strongloop custom script does not exit

From Dev

Strongloop custom script does not exit

From Dev

Strongloop API response limit over Oracle Database

From Dev

Request Headers vs Response Headers

From Dev

Strongloop android sdk custom method error

From Dev

using Django Rest framework to serialize custom data types and return response

From Dev

Custom json response after creating user in Django rest framework

From Dev

How to construct a custom error json response using the Struts framework

From Dev

Django Rest Framework : How to add a custom field to the response of the GET request?

From Dev

Custom API response HTTP status codes with ABP Framework

From Dev

Django Rest Framework : How to add a custom field to the response of the GET request?

From Dev

Custom API response HTTP status codes with ABP Framework

From Dev

How to alter the headers of a Response?

From Dev

Sinatra: Delete Response Headers

From Java

urllib response headers missing

From Dev

JSON Response headers

From Dev

No headers in HAR response

From Dev

Scalatra Set Response Headers

From Dev

AngularJS - get headers in response

From Dev

Interceptor Headers not included in response

Related Related

  1. 1

    Cannot set headers of an Iron framework Response

  2. 2

    How to access angular $http response custom headers?

  3. 3

    Reading Custom HTTP response headers in Angular 2

  4. 4

    Angular returns response without my custom headers

  5. 5

    Access-Control-Expose-Headers Configuration for Custom Response Headers AngularJS

  6. 6

    eve framework send custom response

  7. 7

    Aleph/Clojure - How to insert custom headers in the web socket upgrade response?

  8. 8

    Django Rest Framework custom response message

  9. 9

    Custom throttling response in django rest framework

  10. 10

    Strongloop custom script does not exit

  11. 11

    Strongloop custom script does not exit

  12. 12

    Strongloop API response limit over Oracle Database

  13. 13

    Request Headers vs Response Headers

  14. 14

    Strongloop android sdk custom method error

  15. 15

    using Django Rest framework to serialize custom data types and return response

  16. 16

    Custom json response after creating user in Django rest framework

  17. 17

    How to construct a custom error json response using the Struts framework

  18. 18

    Django Rest Framework : How to add a custom field to the response of the GET request?

  19. 19

    Custom API response HTTP status codes with ABP Framework

  20. 20

    Django Rest Framework : How to add a custom field to the response of the GET request?

  21. 21

    Custom API response HTTP status codes with ABP Framework

  22. 22

    How to alter the headers of a Response?

  23. 23

    Sinatra: Delete Response Headers

  24. 24

    urllib response headers missing

  25. 25

    JSON Response headers

  26. 26

    No headers in HAR response

  27. 27

    Scalatra Set Response Headers

  28. 28

    AngularJS - get headers in response

  29. 29

    Interceptor Headers not included in response

HotTag

Archive