3psilon
3psilon

Reputation: 135

Allow specific hosts to access sails js

I am building a REST API with sails js and I want to allow only a specific white list of hosts to request it. I know that this can be configured in CORS config file for Browser to Server requests. But in my case, I need it for Server to Server requests. Thanks

Upvotes: 2

Views: 82

Answers (1)

Andi N. Dirgantara
Andi N. Dirgantara

Reputation: 2051

CORS of course can't restrict server-server request because it's applied to browser. You must specify it in controller, maybe some kind like using special key request or any kind of authentication that only some requester with some secret key are allowed to access.

Upvotes: 1

Related Questions