olivernn / davis.js

RESTful degradable JavaScript routing using pushState
http://davisjs.com
532 stars 58 forks source link

All request parameters removed if using parameters matching #38

Closed agentgt closed 12 years ago

agentgt commented 12 years ago

Lets say I have a form with method=post and action=/welcome

If I register the URL like:

    var app = Davis(function () {
      this.post('/welcome', function (req) {
        console.log(req.params);
      })
    })

I will get all the input parameters from the form (req.params). Which is nice degrading behavior.

However if use the ":pattern" I will only get the patterns matched as parameters. That is below I will only have the 'name' parameter as a request parameter.

    var app = Davis(function () {
      this.post('/welcome/:name', function (req) {
        console.log(req.params)
      })
    })

This seems like a bug.

agentgt commented 12 years ago

Hmm for some reason this happens only when I submit the form and then click on the back button and try to resubmit the form.

agentgt commented 12 years ago

Sorry seems to have been a weird chrome cache issue.