Initialize RequestPath on demand

Closes gh-33227
This commit is contained in:
rstoyanchev
2024-07-17 15:15:19 +01:00
parent 30a64d6a0b
commit b9509d3c85
2 changed files with 11 additions and 4 deletions

View File

@@ -198,7 +198,7 @@ class ServerHttpRequestTests {
void mutateContextPathWithoutUpdatingPathShouldFail() throws Exception {
ServerHttpRequest request = createRequest("/context/path", "/context");
assertThatThrownBy(() -> request.mutate().contextPath("/fail").build())
assertThatThrownBy(() -> request.mutate().contextPath("/fail").build().getPath())
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Invalid contextPath '/fail': must match the start of requestPath: '/context/path'");
}