Skip to content

Commit

Permalink
Do not prefix url once it starts with http: or https:
Browse files Browse the repository at this point in the history
  • Loading branch information
tdesvenain committed Dec 28, 2017
1 parent 9116edc commit 17fbc97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -30,6 +30,8 @@

- Dont fail in normalising urls if path is null [Sune Wøller]

- Do not prefix url once it starts with http: or https:

# 1.3.1 (2017-11-08)

## Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions src/services/api.service.ts
Expand Up @@ -70,8 +70,8 @@ export class APIService {
getFullPath(path: string): string {
const base = this.config.get('BACKEND_URL');
// if path is already prefixed by base, no need to prefix twice
// if path is already a full url, and base is a local url, no need to prefix either
if (path.startsWith(base) || (base.startsWith('/') && path.startsWith('http'))) {
// if path is already a full url no need to prefix either
if (path.startsWith(base) || path.startsWith('http:') || path.startsWith('https:')) {
return path;
} else {
return base + path;
Expand Down

0 comments on commit 17fbc97

Please sign in to comment.