Skip to content

Commit

Permalink
[docs] Add note in docs for origins(fn) about error needing to be…
Browse files Browse the repository at this point in the history
… a string. (#2895)
  • Loading branch information
sgress454 authored and darrachequesne committed Mar 10, 2018
1 parent 1f1d64b commit ad0c052
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ io.origins(['https://foo.example.com:443']);
- `fn` _(Function)_
- **Returns** `Server`

Provides a function taking two arguments `origin:String` and `callback(error, success)`, where `success` is a boolean value indicating whether origin is allowed or not.
Provides a function taking two arguments `origin:String` and `callback(error, success)`, where `success` is a boolean value indicating whether origin is allowed or not. If `success` is set to `false`, `error` must be provided as a string value that will be appended to the server response, e.g. "Origin not allowed".

__Potential drawbacks__:
* in some situations, when it is not possible to determine `origin` it may have value of `*`
Expand Down

0 comments on commit ad0c052

Please sign in to comment.