aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFredrik Bonander2013-02-06 10:30:40 +0100
committerIgor Minar2013-02-07 02:36:25 -0800
commit7090924515214752b919b0c5630b3ea5e7c77223 (patch)
tree9c46fcda873253e04d7e2ea88aa07a9ad793f796 /src
parentdf744f3af46fc227a934f16cb63c7a6038e7133b (diff)
downloadangular.js-7090924515214752b919b0c5630b3ea5e7c77223.tar.bz2
fix($cookies): set cookies on Safari&IE when base[href] is undefined
Safari and IE don't like being told to store cookies with path set to undefined. This change ensures that if base[href] (from which cookie path is derived) is undefined then the cookie path defaults to ''. The test verifies that the cookie is set instead of checking that cookie has correct path, this is due to that cookie meta information is not avabile once the cookie is set. Closes #1190, #1191
Diffstat (limited to 'src')
-rw-r--r--src/ng/browser.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ng/browser.js b/src/ng/browser.js
index 9682cd28..fa050d54 100644
--- a/src/ng/browser.js
+++ b/src/ng/browser.js
@@ -237,7 +237,7 @@ function Browser(window, document, $log, $sniffer) {
*/
self.baseHref = function() {
var href = baseElement.attr('href');
- return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : href;
+ return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : '';
};
//////////////////////////////////////////////////////////////