You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org> on 2023/03/11 14:48:09 UTC

[GitHub] [dubbo] github-code-scanning[bot] commented on a diff in pull request #11640: Feature/3.2 rest protocol provider

github-code-scanning[bot] commented on code in PR #11640:
URL: https://github.com/apache/dubbo/pull/11640#discussion_r1133093573


##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/JavaxServletRequestFacade.java:
##########
@@ -0,0 +1,297 @@
+/*
+ * 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.dubbo.rpc.protocol.rest.request;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+public class JavaxServletRequestFacade extends RequestFacade<HttpServletRequest> {
+
+
+    public JavaxServletRequestFacade(Object request) {
+        super((HttpServletRequest) request);
+    }
+
+    @Override
+    public Object getParts() throws Exception {
+        return request.getParts();
+    }
+
+    @Override
+    public Object getPart(String var1) throws Exception {
+        return request.getPart(var1);
+    }
+
+    @Override
+    public Object getCookies() {
+        return request.getCookies();
+    }
+
+
+    public long getDateHeader(String name) {
+        return request.getDateHeader(name);
+    }
+
+
+    public String getHeader(String name) {
+        return request.getHeader(name);
+    }
+
+
+    public Enumeration<String> getHeaders(String name) {
+        return request.getHeaders(name);
+    }
+
+
+    public Enumeration<String> getHeaderNames() {
+        return request.getHeaderNames();
+    }
+
+
+    public int getIntHeader(String name) {
+        return request.getIntHeader(name);
+    }
+
+
+    public String getMethod() {
+        return request.getMethod();
+    }
+
+
+    public String getPathInfo() {
+        return path;
+    }
+
+
+    public String getPathTranslated() {
+        return request.getPathTranslated();
+    }
+
+
+    public String getContextPath() {
+        return request.getContextPath();
+    }
+
+
+    public String getQueryString() {
+        return request.getQueryString();
+    }
+
+
+    public String getRemoteUser() {
+        return request.getRemoteUser();
+    }
+
+
+    public boolean isUserInRole(String role) {
+        return request.isUserInRole(role);
+    }
+
+
+    public String getRequestedSessionId() {
+        return request.getRequestedSessionId();

Review Comment:
   ## "HttpServletRequest.getRequestedSessionId()" should not be used
   
   <!--SONAR_ISSUE_KEY:AYbRFC3Dr4kLSu96UJon-->Remove use of this unsecured "getRequestedSessionId()" method <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo&issues=AYbRFC3Dr4kLSu96UJon&open=AYbRFC3Dr4kLSu96UJon&pullRequest=11640">SonarCloud</a></p>
   
   [Show more details](https://github.com/apache/dubbo/security/code-scanning/32)



-- 
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-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org