1

I have the following routing:

...
when('/sections/:bookID', {
        templateUrl: 'partials/book.html',
        controller: 'bookCtrl'       
    })
...

Where bookID is defined as parameter but it is also encrypted and encoded so the resulting URL looks like:

/sections/9XhNLs0tI%2fmr67rkJtfhaw%3d%3d

The issue is that this routing is not working?

PS: The unencrypted value works just fine. So, I know the routing is working.

The Encoding was made in C# like this:

HttpUtility.UrlEncode(Convert.ToBase64String(encrytedBuffer)); 

Do you know why the routing does not work this value 9XhNLs0tI%2fmr67rkJtfhaw%3d%3d it looks fine to me?

3
  • when you say its not working to do mean you can't access the variable in your controller or that its not loading the route view at all? Commented Jan 8, 2014 at 20:40
  • It is not loading the route at all. It loads the default routing. Commented Jan 8, 2014 at 20:44
  • can you post your full route decloration Commented Jan 8, 2014 at 20:45

2 Answers 2

3

The problem is it's being decoded to "9XhNLs0tI/mr67rkJtfhaw==." You should be able to solve it by double encoding / decoding.

Sign up to request clarification or add additional context in comments.

3 Comments

are you suggesting that : HttpUtility.UrlEncode(HttpUtility.UrlEncode(value)) will fix the issue?
@Dalorzo nevermind, you're right. I don't know why but I read that as you being snarky and copy/pasting his existing Url Encoding. Double URL encoding should produce 9XhNLs0tI%252fmr67rkJtfhaw%253d%253d
@Dalarzo I'm pretty sure either would work but I could be off. I haven't had much sleep this week so I'm not exactly firing on all cylinders.
1

The issue is related to these characters: "%2f"

There is a post already on this regards:

Angular JS 'route' doesn't match component with %2F (encoded '/')

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.