{"_id":"connect-cors","_rev":"20-817eccbbd722de12920d8279e7955eaf","name":"connect-cors","description":"CORS / XHR2 support for Node.JS's Connect","dist-tags":{"latest":"0.5.6"},"versions":{"0.0.1":{"name":"connect-cors","description":"CORS middleware for connect","version":"0.0.1","main":"./lib/connect-cors","contributors":[{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com"}],"_id":"connect-cors@0.0.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"https://registry.npmjs.org/connect-cors/-/connect-cors-0.0.1.tgz","shasum":"497ea0a13d7975593d6409518213042d038491db","integrity":"sha512-MBl3ETL5Tlg+4OOrjgUaUBjfLlfM+gfxZZFQgh9V69N/cIu7fhHJSHVkFIcQB1yWmsriGVvd7jEgDEbuPACoHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2ZXXHjGC4U8ol6hywzCX2yF97EUyejv+tTzrw7WgRpgIhAIFFdM91DQtktr6gp5QpLA0toFJHRS/BELNf5zlIa701"}]}},"0.0.2":{"name":"connect-cors","description":"CORS middleware for connect","version":"0.0.2","main":"./lib/connect-cors","contributors":[{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com"}],"_id":"connect-cors@0.0.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.10-1","_nodeVersion":"v0.3.2-pre","dist":{"shasum":"bb8ae6f7561c54f7f88f55edef03a462ff489cac","tarball":"https://registry.npmjs.org/connect-cors/-/connect-cors-0.0.2.tgz","integrity":"sha512-U1AvapUTfx9nE7sZbQaaLC2s4eqoogGIq7G5ZATaVbkFrdxviacFkQ6X5e+8+etjtPlsjpLNFTdeByir+FstpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBaYtWKO4yrA46IJr2zeA8EtkxAXdjgbN290gQELcRP2AiAXqCtFHVMm2vyb9YJVjxCUS62Ymur177eotBpCsC8djQ=="}]}},"0.5.0":{"author":{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com","url":"http://antono.info"},"contributors":[{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"}],"name":"connect-cors","description":"CORS / XHR2 support for Node.JS's Connect","version":"0.5.0","homepage":"https://github.com/antono/connect-cors","repository":{"type":"git","url":"git://github.com/antono/connect-cors.git"},"main":"./lib/connect-cors.js","engines":{"node":">= 0.4.0"},"dependencies":{"connect":">= 1.6.4"},"devDependencies":{"jasmine-node":">= 1.0.6"},"licenses":[{"type":"MIT"}],"_npmJsonOpts":{"file":"/home/antono/.npm/connect-cors/0.5.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"connect-cors@0.5.0","_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"02e3e2a039c42fe059e358107cbec1162247ab46","tarball":"https://registry.npmjs.org/connect-cors/-/connect-cors-0.5.0.tgz","integrity":"sha512-Z1QM2f6vbQoyqFdutoT3r3WOL+FOF62HVaRxi7N2WOoYEykJaxdXG+CjbmcSO4eBXTdoEPESNDN05tTlQwlvkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwojlGsNOEiQvxtbS1XOvXb/1Gke6OQgeBNAPrCJM1LwIgbvTdVCRqzKOiRHTCagyeGG4chJ2MAquYS1XdK4eYrFY="}]},"maintainers":[{"name":"antono","email":"antono.vasiljev@gmail.com"}]},"0.5.1":{"author":{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com","url":"http://antono.info"},"contributors":[{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"}],"name":"connect-cors","description":"CORS / XHR2 support for Node.JS's Connect","version":"0.5.1","homepage":"https://github.com/antono/connect-cors","repository":{"type":"git","url":"git://github.com/antono/connect-cors.git"},"main":"./lib/connect-cors.js","engines":{"node":">= 0.4.0"},"dependencies":{"connect":">= 1.6.4"},"devDependencies":{"jasmine-node":">= 1.0.6"},"licenses":[{"type":"MIT"}],"_npmUser":{"name":"antono","email":"antono.vasiljev@gmail.com"},"_id":"connect-cors@0.5.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"1869a2c14561381f52ee1f7641368e87248b5346","tarball":"https://registry.npmjs.org/connect-cors/-/connect-cors-0.5.1.tgz","integrity":"sha512-PJoI3SHxlohcbjRCWX0ynpCgWjs4GcswPcEdUDwvHhNuEczjVAXRtZ4DmP8HBtlIro4UyuE3EeWMh2t9WsJa9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmq9uaPZ0zTs+OWKs/G6kcH6KhXXK4Ld0Ax7bTC/pK3gIhAIKHS/Rp2ejzCxEjGoiDV6n+QqqYFIntW+EfW+XRMSr+"}]},"maintainers":[{"name":"antono","email":"antono.vasiljev@gmail.com"}]},"0.5.5":{"author":{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com","url":"http://antono.info"},"contributors":[{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"}],"name":"connect-cors","description":"CORS / XHR2 support for Node.JS's Connect","version":"0.5.5","homepage":"https://github.com/antono/connect-cors","repository":{"type":"git","url":"git://github.com/antono/connect-cors.git"},"main":"./lib/connect-cors.js","engines":{"node":">= 0.4.0"},"dependencies":{"connect":">= 1.6.4"},"devDependencies":{"jasmine-node":">= 1.0.6"},"licenses":[{"type":"MIT"}],"bugs":{"url":"https://github.com/antono/connect-cors/issues"},"_id":"connect-cors@0.5.5","dist":{"shasum":"03f4b6edd85e137e0b7bab58cb297e5bbe23add5","tarball":"https://registry.npmjs.org/connect-cors/-/connect-cors-0.5.5.tgz","integrity":"sha512-Y3DiRbUFgoF3vnIzXGktjPrZXsOnwYZsCpmvQHNldZ0zg9wFbtr3eMCD9rTHP12cHfi4JNuaTUO4QpwVM15EAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBeTfgfVHdiCGdLsVVOL/6Jp/DQ6ACCZtBeF2RwQ3KndAiEA8Fj4IfhzCBoRtRBlw4e5trQTvRVnAwNdEAY4dZgGcYc="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"antono","email":"antono.vasiljev@gmail.com"},"maintainers":[{"name":"antono","email":"antono.vasiljev@gmail.com"}]},"0.5.6":{"author":{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com","url":"http://antono.info"},"contributors":[{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"}],"name":"connect-cors","description":"CORS / XHR2 support for Node.JS's Connect","version":"0.5.6","homepage":"https://github.com/antono/connect-cors","repository":{"type":"git","url":"git://github.com/antono/connect-cors.git"},"main":"./lib/connect-cors.js","engines":{"node":">= 0.4.0"},"dependencies":{"connect":">= 1.6.4"},"devDependencies":{"jasmine-node":">= 1.0.6"},"licenses":[{"type":"MIT"}],"bugs":{"url":"https://github.com/antono/connect-cors/issues"},"_id":"connect-cors@0.5.6","dist":{"shasum":"e6ea57f06a4c495e351a759384018c5828d6871b","tarball":"https://registry.npmjs.org/connect-cors/-/connect-cors-0.5.6.tgz","integrity":"sha512-72Y2ohiBhMBLNPVY5rpls2KcmLoZOw2SC5yAvWES+6bplH92XQV/bMgiJwHCKxadAZeXOk38NRnzYWlY+k1Eng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0ZM/x+l3PylL7PxuiGyTHtYXX30h9UOkOPY8588EZXQIgfQZ0q9X7uh4jTfBf3rxKgCUeQ/wy5vIxaal3+/w55dQ="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"antono","email":"antono.vasiljev@gmail.com"},"maintainers":[{"name":"antono","email":"antono.vasiljev@gmail.com"}]}},"maintainers":[{"name":"antono","email":"antono.vasiljev@gmail.com"}],"author":{"name":"Antono Vasiljev","email":"antono.vasiljev@gmail.com","url":"http://antono.info"},"repository":{"type":"git","url":"git://github.com/antono/connect-cors.git"},"time":{"modified":"2022-06-13T21:24:42.149Z","created":"2011-09-15T01:40:39.652Z","0.0.1":"2011-09-15T01:40:39.652Z","0.0.2":"2011-09-15T01:40:39.652Z","0.5.0":"2011-09-15T01:40:39.652Z","0.5.1":"2012-05-24T00:56:12.713Z","0.5.5":"2013-09-23T18:48:51.218Z","0.5.6":"2013-09-23T18:53:11.954Z"},"readme":"# Connect CORS\n\n\nA CORS module for Node.JS's Connect\n\"pre-flighted\" OPTIONS requests are supported\n\n\n## Installation\n\n    npm install connect-cors\n\n\n## Usage\n\n\n    var Connect = require('connect')\n      , CORS = require('connect-cors')\n      , options = {}\n      , server\n      ;\n     \n    server = Connect.createServer(\n        // uses reasonable defaults when no options are given\n        CORS(options)\n      , function(req, res) {\n          res.writeHead(200, { 'Content-Type': 'text/plain' });\n          res.end('Hello World');\n        }\n    );\n\n    // the `options` object will be popullated with empty arrays\n    // and is live-editable (great for testing and dynamic APIs)\n    console.log(options);\n\n    server.listen(9000);\n\n**Known Issues**\n\n  * \"pre-flighted\" OPTIONS requests and \"actual\" requests are treated the same. This doesn't seem to have any adverse affects, it just wastes bytes.\n\n\n## Options\n\nThese are the default options when no options are specified.\n\nThe options are hot-editable. You can dynamically add origins, resources, etc.\n\n    var options = {\n            origins: []                       // implicit same as ['*'], and null\n          , methods: ['HEAD', 'GET', 'POST']  // OPTIONS is always allowed\n          , headers: [                        // both `Exposed` and `Allowed` headers\n                'X-Requested-With'\n              , 'X-HTTP-Method-Override'\n              , 'Content-Type'\n              , 'Accept'\n            ]\n          , credentials: false                // don't allow Credentials\n          , resources: [\n              {\n                  pattern: '/'                // a string prefix or RegExp\n              //, origins\n              //, methods\n              //, headers\n              //, credentials\n              }\n            ]\n        };\n\n\n#### Explanation\n\n\nBy default the defaults will be used.\n\nIf the top-level options are present, they will be used for any resource which does not specify its own\n\nResource-level directives override top-level directives\n\n#### origins\n\nan array of origins. `undefined`, `null`, `[]`, and `['*']` will all default to '*'\n\n  * Example: `['http://example.com', 'http://domain.tld']`\n  * Browsers will see their origin exactly `Access-Control-Allow-Origin: http://example.com` (even if ['*'] is used)\n  * MSIE will see `Access-Control-Allow-Origin: *`, for the allowed origins. (`withCredentials` is broken in MSIE)\n\n#### methods\n\nany HTTP verb will do\n\n#### headers\n\nused for both `Access-Control-Exposed-Headers` and `Access-Contral-Allowed-Headers`\n\n  * TODO make those separate\n\n\n#### credentials\n\nallows XHR2 clients to sepecify `withCredentials = true`, which will send `Cookies` and `HTTP Basic Auth`\n\n  * broken for XDR in MSIE\n\n#### resources\n\nan array of \"directive\" objects\n\n#### pattern\n\n  * pattern (string prefix) - '/path/to' will match '/path/too...', '/path/to/res...', but NOT '/some/path/to...'\n  * pattern (RegExp) - use your own regex matching (to your own peril)\n    * Please see [http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex/6969486#6969486](Escape string for use in Javascript regex) to avoid ugly bugs when creating dynamic regex for paths\n\n## Tests\n\nSee the /test folder. There are some example servers and some basic tests.\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 Antono Vasiljev\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md"}