angular/angular.js — pull request #5019 by brettporter (2013-11-19 05:57:28+00:00)
Title: fix(angular.encodeUriSegment): do not encode semi-colon

RFC 3986 indicates that ; is not encoded as part of the URI, as is the case
with other members of sub-delim. Changed encodeUriSegment to match that
behaviour, along with the corresponding spec.

This was causing a practical issue with Java servers that append `;jsessionid=...` to the path. The `;` was encoded, leading to the following error in PhantomJS as it continually saw the current URL as different to the `$location.absUrl()` which had been encoded:

```
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $locationWatch; newVal: 7; oldVal: 6"],["fn: $locationWatch; newVal: 8; oldVal: 7"],["fn: $locationWatch; newVal: 9; oldVal: 8"],["fn: $locationWatch; newVal: 10; oldVal: 9"],["fn: $locationWatch; newVal: 11; oldVal: 10"]]
```

I note that the specs previously called out `;` specifically for being encoded, which was introduced in 9e30baad3feafc82fb2f2011fd3f21909f4ba29e, and that it has been in place for some time. Is there a reason this might have been needed that I've missed?

I also note that the same code is in `ngResource`, but I'm unfamiliar with the codebase and what impact it would have to change that as well. Should the code in there be updated as well?