Skip to content

Commit ad0c052

Browse files
sgress454darrachequesne
authored andcommitted
[docs] Add note in docs for origins(fn) about error needing to be a string. (socketio#2895)
1 parent 1f1d64b commit ad0c052

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ io.origins(['https://foo.example.com:443']);
239239
- `fn` _(Function)_
240240
- **Returns** `Server`
241241

242-
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.
242+
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".
243243

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

0 commit comments

Comments
 (0)