Comments (6)
Go ahead and make a pull request. @indexzero, @mmalecki, can you check this?
from director.
@stolsma Hmm ... right. In the tightly integrated scenario (i.e. director + union), union is already stripping these characters before it's passed to the router. I suppose we can reparse here, but it should definitely be an option or something.
from director.
@indexzero Are you sure that union is stripping these characters in a integrated scenario? I'm asking this because my test implementation is using union+director and there url parameters doesn't work.... Example how I use it:
var union = require('union');
var router = require('director').http.Router().configure({async: true});
router.get(/foo/, function () {
this.res.writeHead(200, { 'Content-Type': 'text/plain' })
if (this.req.token) {
this.res.end('hello ' + this.req.token.user + '\n');
} else {
this.res.end('hello world\n');
}
});
var server = union.createServer({
before: [
function (req, res) {
var found = router.dispatch(req, res);
if (!found) {
res.emit('next');
}
}
]
});
server.listen(9090);
Is there an easier way to implement my example??
from director.
@stolsma Again, you seem to be right. Union is parsing them, but not stripping them.
https://github.com/flatiron/union/blob/master/lib/request-stream.js#L31-43
Your example is correct.
from director.
@indexzero Thanks for the confirmation! :-)
In my opinion union must not strip anything from req.url
because then we loose the original request url and thats also something I need... ;-)
from director.
yeah, we should probably put the parse somewhere though so we don't have to reparse it.
from director.
Related Issues (20)
- webpack exports-loader Error HOT 1
- catch all or redirect HOT 3
- Router not matching empty paths HOT 1
- Refresh current route? HOT 1
- Hashtag and anchors with the same url
- Undefined POST body HOT 1
- Question about options { strict: true }
- parameters extracted from url are always strings
- Why have to bind this in router function?
- Can be compatible with IE browser?Version 8.0 HOT 1
- why has two request when I click a link and this is use director control for route HOT 1
- Find the new maintainer HOT 8
- Clientside use - having to click back twice. HOT 1
- Make parameter optional
- Not compatible with webpack2 HOT 9
- Cannot create property 'value' on string '(begin)'
- Not sure what I'm doing wrong. Node version: 8.1.3.
- can I use director.js in IE7
- can this lib change the url,example,http://www.aaa.home/home.html to http://www.aaa.home/home
- about 'forward'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from director.