Skip to content
This repository was archived by the owner on Aug 9, 2018. It is now read-only.

Commit 6e280d1

Browse files
Merge pull request #20 from saymedia/mimicUrlResolve
Mimic the behavior of UrlResolve
2 parents 2e55127 + 45c1d85 commit 6e280d1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/ngoverrides.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,16 @@ function registerModule(context) {
586586
}
587587

588588
var baseUrl = serverRequestContext.location.absUrl();
589-
var normalizedVal = url.resolve(baseUrl, uri);
589+
590+
// mimic the behavior of UrlResolve
591+
var normalizedVal;
592+
if (uri === null) {
593+
normalizedVal = url.resolve(baseUrl, '/null');
594+
}
595+
else {
596+
normalizedVal = url.resolve(baseUrl, uri);
597+
}
598+
590599
if (normalizedVal !== '' && !normalizedVal.match(regex)) {
591600
return 'unsafe:' + normalizedVal;
592601
}

0 commit comments

Comments
 (0)