funky-eyes commented on code in PR #7485: URL: https://github.com/apache/incubator-seata/pull/7485#discussion_r2194187943
########## core/src/main/java/org/apache/seata/core/rpc/netty/http/filter/impl/XSSHttpRequestFilter.java: ########## @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seata.core.rpc.netty.http.filter.impl; + +import org.apache.seata.config.ConfigurationFactory; +import org.apache.seata.config.ConfigurationKeys; +import org.apache.seata.core.exception.HttpRequestFilterException; +import org.apache.seata.core.rpc.netty.http.filter.HttpFilterContext; +import org.apache.seata.core.rpc.netty.http.filter.HttpRequestFilter; + +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Filter to detect and block potential XSS attack vectors in HTTP request parameters. + */ +public class XSSHttpRequestFilter implements HttpRequestFilter { Review Comment: > My idea is that the specific filters can be placed on the server side but not managed by the spring container. They can be obtained through spi in the core module. This way, the timing issue of FilterManager being called before the Spring environment is ready can also be avoided. @funky-eyes do you think? I think we should combine SPI and Spring like Dubbo does, where singletons in SPI are also managed by Spring simultaneously, and beans in Spring can also be loaded through SPI, with both being the same singleton. However, this is currently outside the scope of this PR. So I think using either SPI or Spring beans is fine. -- 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: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org