Gathering detailed insights and metrics for connect-cors
Gathering detailed insights and metrics for connect-cors
Gathering detailed insights and metrics for connect-cors
Gathering detailed insights and metrics for connect-cors
npm install connect-cors
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
26 Stars
25 Commits
7 Forks
3 Watching
1 Branches
5 Contributors
Updated on 26 Apr 2024
CoffeeScript (41.2%)
JavaScript (39.66%)
Shell (18.73%)
Makefile (0.4%)
Cumulative downloads
Total Downloads
Last day
-59%
16
Compared to previous day
Last week
-12.6%
285
Compared to previous week
Last month
-43.3%
1,038
Compared to previous month
Last year
260.5%
33,486
Compared to previous year
1
1
DEPRECATED! Use https://www.npmjs.com/package/cors instead
A CORS module for Node.JS's Connect "pre-flighted" OPTIONS requests are supported
npm install connect-cors
1var Connect = require('connect') 2 , CORS = require('connect-cors') 3 , options = {} 4 , server 5 ; 6 7server = Connect.createServer( 8 // uses reasonable defaults when no options are given 9 CORS(options) 10 , function(req, res) { 11 res.writeHead(200, { 'Content-Type': 'text/plain' }); 12 res.end('Hello World'); 13 } 14); 15 16// the `options` object will be popullated with empty arrays 17// and is live-editable (great for testing and dynamic APIs) 18console.log(options); 19 20server.listen(9000);
Known Issues
These are the default options when no options are specified.
The options are hot-editable. You can dynamically add origins, resources, etc.
1var options = { 2 origins: [] // implicit same as ['*'], and null 3 , methods: ['HEAD', 'GET', 'POST'] // OPTIONS is always allowed 4 , headers: [ // both `Exposed` and `Allowed` headers 5 'X-Requested-With' 6 , 'X-HTTP-Method-Override' 7 , 'Content-Type' 8 , 'Accept' 9 ] 10 , credentials: false // don't allow Credentials 11 , resources: [ 12 { 13 pattern: '/' // a string prefix or RegExp 14 //, origins 15 //, methods 16 //, headers 17 //, credentials 18 } 19 ] 20 };
By default the defaults will be used.
If the top-level options are present, they will be used for any resource which does not specify its own
Resource-level directives override top-level directives
an array of origins. undefined
, null
, []
, and ['*']
will all default to '*'
['http://example.com', 'http://domain.tld']
Access-Control-Allow-Origin: http://example.com
(even if ['*'] is used)Access-Control-Allow-Origin: *
, for the allowed origins. (withCredentials
is broken in MSIE)any HTTP verb will do
used for both Access-Control-Exposed-Headers
and Access-Contral-Allowed-Headers
allows XHR2 clients to sepecify withCredentials = true
, which will send Cookies
and HTTP Basic Auth
an array of "directive" objects
See the /test folder. There are some example servers and some basic tests.
(The MIT License)
Copyright (c) 2010 Antono Vasiljev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 4/23 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More