You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v1.1.1 release introduced URI decoding of path and query params, meaning encoded newlines in query strings (?param=foo%0Abar) prevent matching against ANY route since the regular expression dot (.*) doesn't match newlines. This broke things pretty badly for us, which is frustrating for a point-release.
Not sure what the best fix is, but I'm thinking Router#_routeToRegExp should probably be updated to match against newlines as well. That or there should at least be documentation explaining that query params cannot contain encoded newline characters. Thoughts? I'd be happy to attach a PR to this if there's consensus on how this should be resolved.
The text was updated successfully, but these errors were encountered:
@braddunbar thanks for the quick turnaround on this. The new query string handling is nice, can't wait for another version bump so we can try it out. 👍
I think I encountered something related to this in IE 11. Workaround:
// Not sure why, but IE is unable to match routes with `\n` characters in them?
// Re-encoding the characters fixes it.
Backbone.History.prototype.decodeFragment = _.wrap(Backbone.History.prototype.decodeFragment, function (decodeFragment, fragment) {
var decoded = decodeFragment.call(this, fragment);
return decoded.replace(/\n/g, '%0A');
});
Thought I'd share in case anyone else has this issue. I assume it's just an edge-case that will hopefully get fixed in later releases on IE (maybe Edge?).
The v1.1.1 release introduced URI decoding of path and query params, meaning encoded newlines in query strings (
?param=foo%0Abar
) prevent matching against ANY route since the regular expression dot (.*
) doesn't match newlines. This broke things pretty badly for us, which is frustrating for a point-release.Not sure what the best fix is, but I'm thinking
Router#_routeToRegExp
should probably be updated to match against newlines as well. That or there should at least be documentation explaining that query params cannot contain encoded newline characters. Thoughts? I'd be happy to attach a PR to this if there's consensus on how this should be resolved.The text was updated successfully, but these errors were encountered: