Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-cors

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-cors - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

index.js

@@ -85,3 +85,3 @@ /**

if (options.maxAge) {
res.set('Access-Control-Allow-Max-Age', options.maxAge)
res.set('Access-Control-Max-Age', options.maxAge)
}

@@ -88,0 +88,0 @@

{
"name": "express-cors",
"description": "CORS middleware for expressjs",
"version": "v0.0.1",
"version": "v0.0.2",
"url": "http://github.com/0ctave/express-cors",

@@ -6,0 +6,0 @@ "author": "Yuriy Bogdanov <chinsay@gmail.com>",

@@ -37,13 +37,13 @@ # express-cors

* ```https://*.github.com``` - same as above but restrict for https only
* ```github:*``` - allow any port for this host
* ```*.github:*``` - allow any port for this host and any sub-domain
* ```https://*.github:*``` - same as above but restrict for https only
* ```github.com:*``` - allow any port for this host
* ```*.github.com:*``` - allow any port for this host and any sub-domain
* ```https://*.github.com:*``` - same as above but restrict for https only
You've got the idea… If not, see `test.js` for more examples.
You've got the idea… If not, see [test.js](https://github.com/0ctave/express-cors/blob/master/test.js) for more examples.
### Other options
* **`methods`** - array of allowed methods (default value is `GET, POST, PUT, DELETE, PATCH, OPTIONS`)
* **`headers`** - array of allowed headers (default value is `X-Requested-With, Content-Type`)
* **`maxAge`** - value for `Access-Control-Allow-Max-Age` header (default is `none`)
* `methods` - array of allowed methods (default value is `GET, POST, PUT, DELETE, PATCH, OPTIONS`)
* `headers` - array of allowed headers (default value is `X-Requested-With, Content-Type`)
* `maxAge` - value for `Access-Control-Allow-Max-Age` header (default is `none`)

@@ -65,2 +65,2 @@ # Running Tests

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.
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.

@@ -489,3 +489,3 @@ var assert = require("assert"),

describe('Access-Control-Allow-Max-Age', function(){
describe('Access-Control-Max-Age', function(){

@@ -501,3 +501,3 @@ it('should not be by default', function(){

assert.equal(undefined, headers['Access-Control-Allow-Max-Age'])
assert.equal(undefined, headers['Access-Control-Max-Age'])
})

@@ -515,3 +515,3 @@

assert.equal(3600, headers['Access-Control-Allow-Max-Age'])
assert.equal(3600, headers['Access-Control-Max-Age'])
})

@@ -518,0 +518,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc