antono / connect-cors Goto Github PK
View Code? Open in Web Editor NEWconnect-cors
connect-cors
I'm currently working on this, but I'm having some issues. Mind helping out?
If you don't plan to work on this project anymore, will you click on the admin
button of the project and transfer ownership to one of the other forks?
Hi, appreciate the library! We're using it with success, but one issue - the way you're using the input config object, config.origins is an input array that you're modifying by replacing the input strings with a RegExp object.
This would be fine except array objects are pass by reference, so if multiple node apps are sharing the same CORS settings object (we're doing this during unit tests)...once the next app tries to send the same settings object back into your library (where some of the strings have become RegExp objects), it results in this error:
TypeError: Object /^http:\/\/localhost:4003(:|$)/ has no method 'toLowerCase'
at origin (/Users/mrobben/devproj/sold-backend/node_modules/connect-xcors/connect-cors.js:121:36)
at Array.forEach (native)
at create (/Users/mrobben/devproj/sold-backend/node_modules/connect-xcors/connect-cors.js:119:22)
I'm happy to fix this for you in one of 3 ways -
Needs an option to add Access-Control-Max-Age: 600
What's the correct way to read POST request payload? I'm using connect-xcors and I can't seem to find where POST payload is stored.
var server = connect.createServer(
connect.logger(),
CORS(options),
connect.bodyParser(), function(req,res) {
var foo = req.body.foo; /* this is where bodyParser() stores the payload */
res.end();
}
)
I first thought it was connect.bodyParser() that was messing with me but removing that didn't solve the issue. All help is appreciated.
I'm going to fork this and put my name in an AUTHORS file at the root. It looks like the code is pretty much the same as when I pull requested it, with perhaps a few additional bug fixes... and at least one new bug - being translated to coffeescript ;-P
When I'm using it as a portfolio item I want to be able to show that I indeed had a major role in the creation of the module.
Hi,
Could you pull from https://github.com/zandaq/connect-cors to fix access-control-allow-credentials:true
Thx
Romain
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.