{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/2833","repository_url":"https://api.github.com/repos/angular/angular.js","labels_url":"https://api.github.com/repos/angular/angular.js/issues/2833/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/2833/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/2833/events","html_url":"https://github.com/angular/angular.js/issues/2833","id":14967982,"number":2833,"title":"bug($location): incorrect URL parsing when (1) angular app lives under a subdirectory (2) HTML5 routing is off and (3) there's no trailing slash when accessing app root","user":{"login":"chibicode","id":992008,"avatar_url":"https://avatars.githubusercontent.com/u/992008?v=3","gravatar_id":"","url":"https://api.github.com/users/chibicode","html_url":"https://github.com/chibicode","followers_url":"https://api.github.com/users/chibicode/followers","following_url":"https://api.github.com/users/chibicode/following{/other_user}","gists_url":"https://api.github.com/users/chibicode/gists{/gist_id}","starred_url":"https://api.github.com/users/chibicode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibicode/subscriptions","organizations_url":"https://api.github.com/users/chibicode/orgs","repos_url":"https://api.github.com/users/chibicode/repos","events_url":"https://api.github.com/users/chibicode/events{/privacy}","received_events_url":"https://api.github.com/users/chibicode/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20$location","name":"component: $location","color":"fef2c0"},{"url":"https://api.github.com/repos/angular/angular.js/labels/frequency:%20moderate","name":"frequency: moderate","color":"fef2c0"},{"url":"https://api.github.com/repos/angular/angular.js/labels/severity:%20confusing","name":"severity: confusing","color":"cd19e7"},{"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20bug","name":"type: bug","color":"000000"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/27","html_url":"https://github.com/angular/angular.js/milestones/Backlog","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/27/labels","id":489171,"number":27,"title":"Backlog","description":"Holds the backlog of issues and pull requests that have been triaged.\r\n\r\nBefore assigning items to this milestone they should be labelled, at the very least with the correct \"type\" label (i.e. \"issue\", \"pr\", \"bug\", \"regression\", \"chore\", \"docs\", etc).  Preferably you should also check for duplicate issues/PRs, note CLA status and assign \"complexity\" and \"impact\" labels too.","creator":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":501,"closed_issues":1436,"state":"open","created_at":"2013-11-18T23:30:35Z","updated_at":"2016-10-18T12:21:19Z","due_on":null,"closed_at":null},"comments":23,"created_at":"2013-05-30T23:52:41Z","updated_at":"2016-10-18T12:21:19Z","closed_at":"2016-10-18T12:21:19Z","body":"Suppose you turned off HTML5 routing and your app lives at\r\n\r\n~~~\r\nhttp://localhost:5000/angular-app/\r\n~~~\r\n\r\nOn version 1.1.5, if you navigate **instead** to a URL with no trailing slash, e.g.\r\n\r\n~~~\r\nhttp://localhost:5000/angular-app\r\n~~~\r\n\r\nthen it redirects to:\r\n\r\n~~~\r\nhttp://localhost:5000/angular-app/#angular-app\r\n~~~\r\n\r\nI tracked down the problem - it's on this line:\r\nhttps://github.com/angular/angular.js/blob/v1.1.5/src/ng/location.js#L158\r\n\r\n* If there's trailing slash (i.e. `http://localhost:5000/angular-app/`), `beginsWith(appBase, url)` returns `/`. So `withoutBaseUrl` is set as `/`.\r\n* However, if there's no trailing slash (i.e. `http://localhost:5000/angular-app`), `beginsWith(appBase, url)` returns an empty string, and it evaluates `beginsWith(appBaseNoFile, url)`, which returns `angular-app`.  So `withoutBaseUrl` is set as `angular-app`.\r\n\r\nAs a result, when HTML5 route is off, `this.$$parse` behaves differently for `http://localhost:5000/angular-app` (no trailing slash) and `http://localhost:5000/angular-app/` (trailing slash), even though they should return the same thing.\r\n\r\nThe change is introduced on this commit (cc @mhevery) https://github.com/angular/angular.js/commit/58ef32308f45141c8f7f7cc32a6156cd328ba692 \r\n\r\nThis is not a problem when (1) HTML5 routing is on (e.g. `$locationProvider.html5Mode(true).hashPrefix('!')`) and (2) `<base href=\"/angular-app/\"` is added to `<head>`."},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/254490720","html_url":"https://github.com/angular/angular.js/issues/2833#issuecomment-254490720","issue_url":"https://api.github.com/repos/angular/angular.js/issues/2833","id":254490720,"user":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T12:21:19Z","updated_at":"2016-10-18T12:21:19Z","body":"Location has seen some major changes since 1.1.5, so this probably has been solved. If somebody encounter this problem again, please open a new issue."}}
{"actor":{"display_login":"Narretz"}}