|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2022 the original author or authors. |
|
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
|
@ -149,7 +149,8 @@ public class MockHttpServletRequestBuilder
@@ -149,7 +149,8 @@ public class MockHttpServletRequestBuilder
|
|
|
|
|
Assert.notNull(url, "'url' must not be null"); |
|
|
|
|
Assert.isTrue(url.isEmpty() || url.startsWith("/") || url.startsWith("http://") || url.startsWith("https://"), |
|
|
|
|
() -> "'url' should start with a path or be a complete HTTP URL: " + url); |
|
|
|
|
return UriComponentsBuilder.fromUriString(url).buildAndExpand(vars).encode().toUri(); |
|
|
|
|
String uriString = (url.isEmpty() ? "/" : url); |
|
|
|
|
return UriComponentsBuilder.fromUriString(uriString).buildAndExpand(vars).encode().toUri(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|