Fix http URLs
See gh-22839
This commit is contained in:
committed by
Stephane Nicoll
parent
b5fba14ab8
commit
fde92793b5
@@ -191,12 +191,12 @@ public class ServletUriComponentsBuilder extends UriComponentsBuilder {
|
||||
* requestURI}. This method must be invoked before any calls to {@link #path(String)}
|
||||
* or {@link #pathSegment(String...)}.
|
||||
* <pre>
|
||||
* GET http://www.foo.com/rest/books/6.json
|
||||
* GET http://www.foo.example/rest/books/6.json
|
||||
*
|
||||
* ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromRequestUri(this.request);
|
||||
* String ext = builder.removePathExtension();
|
||||
* String uri = builder.path("/pages/1.{ext}").buildAndExpand(ext).toUriString();
|
||||
* assertEquals("http://www.foo.com/rest/books/6/pages/1.json", result);
|
||||
* assertEquals("http://www.foo.example/rest/books/6/pages/1.json", result);
|
||||
* </pre>
|
||||
* @return the removed path extension for possible re-use, or {@code null}
|
||||
* @since 4.0
|
||||
|
||||
@@ -211,7 +211,7 @@ public class CrossOriginTests {
|
||||
CorsConfiguration config = getCorsConfiguration(chain, false);
|
||||
assertThat(config).isNotNull();
|
||||
assertThat(config.getAllowedMethods().toArray()).isEqualTo(new String[] {"GET"});
|
||||
assertThat(config.getAllowedOrigins().toArray()).isEqualTo(new String[] {"http://www.foo.com/"});
|
||||
assertThat(config.getAllowedOrigins().toArray()).isEqualTo(new String[] {"http://www.foo.example/"});
|
||||
assertThat((boolean) config.getAllowCredentials()).isTrue();
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public class CrossOriginTests {
|
||||
CorsConfiguration config = getCorsConfiguration(chain, false);
|
||||
assertThat(config).isNotNull();
|
||||
assertThat(config.getAllowedMethods().toArray()).isEqualTo(new String[] {"GET"});
|
||||
assertThat(config.getAllowedOrigins().toArray()).isEqualTo(new String[] {"http://www.foo.com/"});
|
||||
assertThat(config.getAllowedOrigins().toArray()).isEqualTo(new String[] {"http://www.foo.example/"});
|
||||
assertThat((boolean) config.getAllowCredentials()).isTrue();
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ public class CrossOriginTests {
|
||||
|
||||
|
||||
@Controller
|
||||
@ComposedCrossOrigin(origins = "http://www.foo.com/", allowCredentials = "true")
|
||||
@ComposedCrossOrigin(origins = "http://www.foo.example/", allowCredentials = "true")
|
||||
private static class ClassLevelMappingWithComposedAnnotation {
|
||||
|
||||
@RequestMapping(path = "/foo", method = RequestMethod.GET)
|
||||
@@ -431,7 +431,7 @@ public class CrossOriginTests {
|
||||
private static class MethodLevelMappingWithComposedAnnotation {
|
||||
|
||||
@RequestMapping(path = "/foo", method = RequestMethod.GET)
|
||||
@ComposedCrossOrigin(origins = "http://www.foo.com/", allowCredentials = "true")
|
||||
@ComposedCrossOrigin(origins = "http://www.foo.example/", allowCredentials = "true")
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,10 +109,10 @@ public class AppCacheManifestTransformerTests {
|
||||
|
||||
assertThat(content).as("not rewrite external resources")
|
||||
.contains("//example.org/style.css")
|
||||
.contains("http://example.org/image.png");
|
||||
.contains("https://example.org/image.png");
|
||||
|
||||
assertThat(content).as("generate fingerprint")
|
||||
.contains("# Hash: 4bf0338bcbeb0a5b3a4ec9ed8864107d");
|
||||
.contains("# Hash: 65ebc023e50b2b731fcace2871f0dae3");
|
||||
}
|
||||
|
||||
private Resource getResource(String filePath) {
|
||||
|
||||
@@ -208,13 +208,13 @@ public class RedirectViewTests {
|
||||
|
||||
assertThat(rv.isRemoteHost("https://url.somewhere.com")).isFalse();
|
||||
assertThat(rv.isRemoteHost("/path")).isFalse();
|
||||
assertThat(rv.isRemoteHost("http://url.somewhereelse.com")).isFalse();
|
||||
assertThat(rv.isRemoteHost("http://somewhereelse.example")).isFalse();
|
||||
|
||||
rv.setHosts(new String[] {"url.somewhere.com"});
|
||||
|
||||
assertThat(rv.isRemoteHost("https://url.somewhere.com")).isFalse();
|
||||
assertThat(rv.isRemoteHost("/path")).isFalse();
|
||||
assertThat(rv.isRemoteHost("http://url.somewhereelse.com")).isTrue();
|
||||
assertThat(rv.isRemoteHost("http://somewhereelse.example")).isTrue();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ NETWORK:
|
||||
|
||||
CACHE:
|
||||
js/bar.js
|
||||
http://example.org/image.png
|
||||
https://example.org/image.png
|
||||
|
||||
FALLBACK:
|
||||
/main /static.html
|
||||
Reference in New Issue
Block a user