justinfagnani / route

A client + server routing library for Dart
BSD 3-Clause "New" or "Revised" License
114 stars 40 forks source link

Query string does not work #56

Open donny-dont opened 10 years ago

donny-dont commented 10 years ago

Currently the '?' character is not marked as a special character so when encountered it does not add a \ in front of it. Adding \? within the string itself does not help as this gets stripped.

pavelgj commented 10 years ago

Are you using route or route_hierarchical?

justinfagnani commented 10 years ago

It's just route, I'm looking into it now, the example hasn't been updated for 1.0, so it's likely that the server isn't running at all.

On Mon, Nov 11, 2013 at 7:14 PM, Pavel Jbanov notifications@github.comwrote:

Are you using route or route_hierarchical?

— Reply to this email directly or view it on GitHubhttps://github.com/dart-lang/route/issues/56#issuecomment-28264654 .

justinfagnani commented 10 years ago

Oops, I got my signals crossed between here and Stack Overflow :) disregard

On Mon, Nov 11, 2013 at 7:18 PM, Justin Fagnani justinfagnani@google.comwrote:

It's just route, I'm looking into it now, the example hasn't been updated for 1.0, so it's likely that the server isn't running at all.

On Mon, Nov 11, 2013 at 7:14 PM, Pavel Jbanov notifications@github.comwrote:

Are you using route or route_hierarchical?

— Reply to this email directly or view it on GitHubhttps://github.com/dart-lang/route/issues/56#issuecomment-28264654 .

donny-dont commented 10 years ago

Not sure if I need to be more specific but just in case. If you have a url you're trying to match that looks like

http://foo.com/index.html?bar=123

If you tried to make a UrlPattern to get the value of bar you can't because the ? is not treated as a special character that should have a \ added to it. This is because of the following from url_pattern.dart

final _specialChars = new RegExp(r'[\^\$\.\|\+\[\]\{\}]');

Which does not contain ?. You also can't just add a \? to the pattern as the \ gets removed.