Use HTTPS for external links where possible
See gh-609
This commit is contained in:
committed by
Andy Wilkinson
parent
4fdb1f5361
commit
f2e60ea347
@@ -68,23 +68,23 @@ public class LinkExtractorsPayloadTests {
|
||||
public void singleLink() throws IOException {
|
||||
Map<String, List<Link>> links = this.linkExtractor
|
||||
.extractLinks(createResponse("single-link"));
|
||||
assertLinks(Arrays.asList(new Link("alpha", "http://alpha.example.com")), links);
|
||||
assertLinks(Arrays.asList(new Link("alpha", "https://alpha.example.com")), links);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multipleLinksWithDifferentRels() throws IOException {
|
||||
Map<String, List<Link>> links = this.linkExtractor
|
||||
.extractLinks(createResponse("multiple-links-different-rels"));
|
||||
assertLinks(Arrays.asList(new Link("alpha", "http://alpha.example.com"),
|
||||
new Link("bravo", "http://bravo.example.com")), links);
|
||||
assertLinks(Arrays.asList(new Link("alpha", "https://alpha.example.com"),
|
||||
new Link("bravo", "https://bravo.example.com")), links);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multipleLinksWithSameRels() throws IOException {
|
||||
Map<String, List<Link>> links = this.linkExtractor
|
||||
.extractLinks(createResponse("multiple-links-same-rels"));
|
||||
assertLinks(Arrays.asList(new Link("alpha", "http://alpha.example.com/one"),
|
||||
new Link("alpha", "http://alpha.example.com/two")), links);
|
||||
assertLinks(Arrays.asList(new Link("alpha", "https://alpha.example.com/one"),
|
||||
new Link("alpha", "https://alpha.example.com/two")), links);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": "http://alpha.example.com",
|
||||
"bravo": "http://bravo.example.com"
|
||||
"alpha": "https://alpha.example.com",
|
||||
"bravo": "https://bravo.example.com"
|
||||
},
|
||||
"_embedded": "embedded-test",
|
||||
"beta": "beta-value",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": "http://alpha.example.com",
|
||||
"bravo": "http://bravo.example.com"
|
||||
"alpha": "https://alpha.example.com",
|
||||
"bravo": "https://bravo.example.com"
|
||||
},
|
||||
"beta": "beta-value",
|
||||
"charlie": "charlie-value"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "https://alpha.example.com"
|
||||
}, {
|
||||
"rel": "bravo",
|
||||
"href": "http://bravo.example.com"
|
||||
"href": "https://bravo.example.com"
|
||||
} ]
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com/one"
|
||||
"href": "https://alpha.example.com/one"
|
||||
}, {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com/two"
|
||||
"href": "https://alpha.example.com/two"
|
||||
} ]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "https://alpha.example.com"
|
||||
} ]
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"links": {
|
||||
"alpha": [{
|
||||
"href": "http://alpha.example.com/one"
|
||||
"href": "https://alpha.example.com/one"
|
||||
}, {
|
||||
"href": "http://alpha.example.com/two"
|
||||
"href": "https://alpha.example.com/two"
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": {
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "https://alpha.example.com"
|
||||
},
|
||||
"bravo": {
|
||||
"href": "http://bravo.example.com"
|
||||
"href": "https://bravo.example.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": [{
|
||||
"href": "http://alpha.example.com/one"
|
||||
"href": "https://alpha.example.com/one"
|
||||
}, {
|
||||
"href": "http://alpha.example.com/two"
|
||||
"href": "https://alpha.example.com/two"
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": {
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "https://alpha.example.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"_links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com/one"
|
||||
"href": "https://alpha.example.com/one"
|
||||
}, {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com/two"
|
||||
"href": "https://alpha.example.com/two"
|
||||
} ]
|
||||
}
|
||||
Reference in New Issue
Block a user