Skip to content

Commit 7f1a682

Browse files
dhananjaysa92Dhananjay Agrawal
andauthored
docs: extend origin option for * (#289)
Co-authored-by: Dhananjay Agrawal <dhananjay.agrawal@aexp.com>
1 parent 70eadc4 commit 7f1a682

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ app.listen(80, function () {
212212

213213
* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values:
214214
- `Boolean` - set `origin` to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS.
215-
- `String` - set `origin` to a specific origin. For example if you set it to `"http://example.com"` only requests from "http://example.com" will be allowed.
215+
- `String` - set `origin` to a specific origin. For example, if you set it to
216+
- `"http://example.com"` only requests from "http://example.com" will be allowed.
217+
- `"*"` for all domains to be allowed.
216218
- `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com".
217219
- `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com".
218220
- `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (called as `callback(err, origin)`, where `origin` is a non-function value of the `origin` option) as the second.

0 commit comments

Comments
 (0)