{"issue":{"user":{"id":2377,"login":"jdelStrother","url":"https://api.github.com/users/jdelStrother","avatar_url":"https://secure.gravatar.com/avatar/a9e5ce6f28587baa2a566eb4f2d76c13?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a9e5ce6f28587baa2a566eb4f2d76c13"},"milestone":{"creator":{"id":1979,"login":"jonleighton","url":"https://api.github.com/users/jonleighton","avatar_url":"https://secure.gravatar.com/avatar/2940bc7d4506f3e099e3dcc32a412b98?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2940bc7d4506f3e099e3dcc32a412b98"},"open_issues":7,"created_at":"2011-05-12T20:18:19Z","title":"Rails 3.2","state":"open","due_on":null,"closed_issues":18,"number":3,"description":"","url":"https://api.github.com/repos/rails/rails/milestones/3"},"created_at":"2011-12-22T16:46:12Z","title":"Route constraints match empty strings in 3.2 ?","updated_at":"2011-12-22T20:50:53Z","labels":[],"state":"open","id":2639090,"html_url":"https://github.com/rails/rails/issues/4136","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":null,"number":4136,"body":"Hi,\r\nI have the following route : \r\n```\r\nget ':username'=>'users#show', :username=>/[^\\/]+/\r\n```\r\nfor 'twitter style' profile urls, routing http://localhost:3000/foo to {:controller=>'users', :action=>'show', :username=>'foo'}\r\n\r\nUnder 3.2, this constraint now seems to match an empty string : if I visit http://localhost:3000/, it calls the users#show action with {\"username\"=>\"\"} as a parameter.\r\n\r\nAm I doing something wrong, or does it need further investigation?","url":"https://api.github.com/repos/rails/rails/issues/4136","comments":5,"assignee":null},"comment":{"user":{"id":3124,"login":"tenderlove","url":"https://api.github.com/users/tenderlove","avatar_url":"https://secure.gravatar.com/avatar/f29327647a9cff5c69618bae420792ea?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f29327647a9cff5c69618bae420792ea"},"created_at":"2011-12-22T20:50:53Z","updated_at":"2011-12-22T20:50:53Z","id":3254655,"body":"Ya, the generated regex seems to mark that as optional. I'll also take a look when I get home.\r\n\r\n--\r\nAaron Patterson\r\nhttp://tenderlovemaking.com/\r\n\r\nOn Dec 22, 2011, at 1:43 PM, Andrew White<reply@reply.github.com> wrote:\r\n\r\n> @tenderlove this is a definite regression from 3.1 -> 3.2, I'll see if I can track down where the problem is.\r\n> \r\n> The problem only occurs if there's a constraint - leaving out the regexp works as expected.\r\n> \r\n> --- \r\n> Reply to this email directly or view it on GitHub:\r\n> https://github.com/rails/rails/issues/4136#issuecomment-3254561","url":"https://api.github.com/repos/rails/rails/issues/comments/3254655"},"action":"created"}