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

Commit a22596c

Browse files
committed
test($compile): use FQDN for img[src]
img[src]="https://foo" has the unfortunate problem that the browser will actually try retrieving the resource the non FQDN foo. The local DNS might suffix a domain to this, resolve it, and try to present a certificate for the https request and prompt the user to pick a certificate. This commit avoids that by making foo a FQDN. Note that it might be better to replace foo with example.com (ref http://tools.ietf.org/html/rfc2606#section-3).
1 parent 0e254cc commit a22596c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/ng/compileSpec.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2620,21 +2620,21 @@ describe('$compile', function() {
26202620
$rootScope.$apply();
26212621
expect(element.attr('src')).toBe('#foo');
26222622

2623-
$rootScope.testUrl = "http://foo/bar";
2623+
$rootScope.testUrl = "http://foo.com/bar";
26242624
$rootScope.$apply();
2625-
expect(element.attr('src')).toBe('http://foo/bar');
2625+
expect(element.attr('src')).toBe('http://foo.com/bar');
26262626

2627-
$rootScope.testUrl = " http://foo/bar";
2627+
$rootScope.testUrl = " http://foo.com/bar";
26282628
$rootScope.$apply();
2629-
expect(element.attr('src')).toBe(' http://foo/bar');
2629+
expect(element.attr('src')).toBe(' http://foo.com/bar');
26302630

2631-
$rootScope.testUrl = "https://foo/bar";
2631+
$rootScope.testUrl = "https://foo.com/bar";
26322632
$rootScope.$apply();
2633-
expect(element.attr('src')).toBe('https://foo/bar');
2633+
expect(element.attr('src')).toBe('https://foo.com/bar');
26342634

2635-
$rootScope.testUrl = "ftp://foo/bar";
2635+
$rootScope.testUrl = "ftp://foo.com/bar";
26362636
$rootScope.$apply();
2637-
expect(element.attr('src')).toBe('ftp://foo/bar');
2637+
expect(element.attr('src')).toBe('ftp://foo.com/bar');
26382638

26392639
// Fails on IE < 10 with "TypeError: Access is denied" when trying to set img[src]
26402640
if (!msie || msie > 10) {

0 commit comments

Comments
 (0)