Resolve UriComponentsBuilder argument with contextPath
Closes gh-25822
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -111,7 +111,8 @@ public class ServerWebExchangeMethodArgumentResolver extends HandlerMethodArgume
|
||||
}
|
||||
else if (UriBuilder.class == paramType || UriComponentsBuilder.class == paramType) {
|
||||
URI uri = exchange.getRequest().getURI();
|
||||
return UriComponentsBuilder.fromUri(uri).replacePath(null).replaceQuery(null);
|
||||
String contextPath = exchange.getRequest().getPath().contextPath().value();
|
||||
return UriComponentsBuilder.fromUri(uri).replacePath(contextPath).replaceQuery(null);
|
||||
}
|
||||
else {
|
||||
// should never happen...
|
||||
|
||||
Reference in New Issue
Block a user