fix: can't upload container #843

This commit is contained in:
tjq 2024-03-16 21:53:26 +08:00
parent 9b5916daf3
commit 6a59f50b96
2 changed files with 8 additions and 1 deletions

View File

@ -336,7 +336,6 @@ public class ContainerService {
sb.append("WARN: there exists multi version container now, please redeploy to fix this problem").append(System.lineSeparator()); sb.append("WARN: there exists multi version container now, please redeploy to fix this problem").append(System.lineSeparator());
} }
sb.append("divisive version ==> ").append(System.lineSeparator());
version2DeployedContainerInfoList.asMap().forEach((version, deployedContainerInfos) -> { version2DeployedContainerInfoList.asMap().forEach((version, deployedContainerInfos) -> {
sb.append("[version] ").append(version).append(System.lineSeparator()); sb.append("[version] ").append(version).append(System.lineSeparator());
deployedContainerInfos.forEach(deployedContainerInfo -> sb.append(String.format("Address: %s, DeployedTime: %s", deployedContainerInfo.getWorkerAddress(), CommonUtils.formatTime(deployedContainerInfo.getDeployedTime()))).append(System.lineSeparator())); deployedContainerInfos.forEach(deployedContainerInfo -> sb.append(String.format("Address: %s, DeployedTime: %s", deployedContainerInfo.getWorkerAddress(), CommonUtils.formatTime(deployedContainerInfo.getDeployedTime()))).append(System.lineSeparator()));

View File

@ -29,10 +29,18 @@ public class CachingRequestBodyFilter implements Filter {
*/ */
private static final Set<String> IGNORE_CONTENT_TYPES = Sets.newHashSet("application/x-www-form-urlencoded", "multipart/form-data"); private static final Set<String> IGNORE_CONTENT_TYPES = Sets.newHashSet("application/x-www-form-urlencoded", "multipart/form-data");
private static final Set<String> IGNORE_URIS = Sets.newHashSet("/container/jarUpload");
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException { throws IOException, ServletException {
if (request instanceof HttpServletRequest) { if (request instanceof HttpServletRequest) {
String uri = ((HttpServletRequest) request).getRequestURI();
// 忽略 jar 上传等处理路径
if (IGNORE_URIS.contains(uri)) {
chain.doFilter(request, response);
return;
}
String contentType = request.getContentType(); String contentType = request.getContentType();
if (contentType != null && !IGNORE_CONTENT_TYPES.contains(contentType)) { if (contentType != null && !IGNORE_CONTENT_TYPES.contains(contentType)) {
CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper((HttpServletRequest) request); CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper((HttpServletRequest) request);