1

I am trying to pass targetURL using get method. This is the URL that i tried: http://localhost:8000/login/auth?targetURL=www.google.com Backbone.js will return "Cannot GET /login/auth?targetURL=www.google.com"

By right, get variable should not affect the module i'm going into it. if i remove the "period", the url works well. for e.g : http://localhost:8000/login/auth?targetURL=wwwgooglecom

this is how my routes look like

routes: {
        'logout': 'logout',
        ':level1': 'subpageAction',
        'logout/:authFail': 'logout',
        ':level1/:level2': 'subpageAction',
        ':level1/:level2/:level3': 'subpageAction',
        ':level1/:level2/:level3/:level4': 'subpageAction',
        '': 'subpageAction'
    },

Does anyone have the same issue? The issue only happen when i put "." in my url. Anyone can help on this issue?

Kimberlee Ho
  • 447
  • 1
  • 6
  • 23

1 Answers1

1

You are running into RFC 3986 issues. While W3C standards for form submission declared that the dot didn't need to be substituted with %2E, practice is that there are been so many hacks with '..' hiding in form submissions that different layers of software will trip you up rendering even encoding the dot as %2E ineffective.

One solution that may work, depending on your exact use case, is to toss a trailing slash to the end of the URL, e.g., www.google.com/ instead of www.google.com.

You might want to look at these two questions as well. There is no perfect answer here, just near perfect ones.

Community
  • 1
  • 1
Charles Merriam
  • 19,908
  • 6
  • 73
  • 83