sollhui commented on code in PR #63332:
URL: https://github.com/apache/doris/pull/63332#discussion_r3271120138
##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java:
##########
@@ -88,38 +88,51 @@ public ActionAuthorizationInfo
executeCheckPassword(HttpServletRequest request,
return authInfo;
}
- public RedirectView redirectTo(HttpServletRequest request, TNetworkAddress
addr) {
- RedirectView redirectView = new RedirectView(getRedirectUrL(request,
addr));
- redirectView.setContentType("text/html;charset=utf-8");
-
redirectView.setStatusCode(org.springframework.http.HttpStatus.TEMPORARY_REDIRECT);
- return redirectView;
+ protected String buildRedirectUrl(HttpServletRequest request,
TNetworkAddress addr) {
+ return buildRedirectUrl(request, addr, request.getRequestURI(),
request.getQueryString());
}
- public String getRedirectUrL(HttpServletRequest request, TNetworkAddress
addr) {
- URI urlObj = null;
+ protected String buildRedirectUrl(HttpServletRequest request,
TNetworkAddress addr, String requestPath,
+ String queryString) {
URI resultUriObj = null;
- String urlStr = request.getRequestURI();
String userInfo = null;
if (!Strings.isNullOrEmpty(request.getHeader("Authorization"))) {
ActionAuthorizationInfo authInfo = getAuthorizationInfo(request);
userInfo = authInfo.fullUserName + ":" + authInfo.password;
}
try {
- urlObj = new URI(urlStr);
resultUriObj = new URI(request.getScheme(), userInfo,
addr.getHostname(),
- addr.getPort(), urlObj.getPath(), "", null);
+ addr.getPort(), requestPath, null, null);
Review Comment:
It seems that double-encode the encoded path?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]