Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

<base href="./"> cause angularjs crash #5317

@peichao01

Description

@peichao01

i think this is a bug, when the base element in html set to like ./, will cause angularjs crash.

this make angular think the site's appBase is "http://site.com./", one more point at the end of the valid url.

line 8961

appBase = serverBase(initialUrl) + (baseHref || '/');

but the baseHref here is ./.

the error mssages are here:

Error: [$location:ipthprfx] Invalid url "undefined", missing path prefix "http://angularjs.peichao01.com./".
http://errors.angularjs.org/1.2.4/$location/ipthprfx?p0=undefined&p1=http%3A%2F%2Fangularjs.peichao01.com.%2F
    at http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:78:12
    at Object.$$parse (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:8456:13)
    at $LocationProvider.$get (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:8966:15)
    at Object.invoke (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:3652:28)
    at http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:3485:37
    at getService (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:3606:39)
    at invoke (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:3628:13)
    at Object.instantiate (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:3664:23)
    at $get (http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:6685:28)
    at http://angularjs.peichao01.com/googleapis/ajax/libs/angularjs/1.2.4/angular.js:6098:34 angular.js:9199
(anonymous function) angular.js:9199
$get angular.js:6752
$get.Scope.$apply angular.js:11799
(anonymous function) angular.js:1297
invoke angular.js:3644
doBootstrap angular.js:1295
bootstrap angular.js:1309
(anonymous function)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions