This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 100d76510c7 [Fix](HttpServer) Refactor API Endpoints to Only Allow GET
Requests for Enhanced Security (#24855)
100d76510c7 is described below
commit 100d76510c75441f9850f513694fb98e87f63563
Author: zy-kkk <[email protected]>
AuthorDate: Wed Sep 27 04:10:11 2023 -0500
[Fix](HttpServer) Refactor API Endpoints to Only Allow GET Requests for
Enhanced Security (#24855)
---
.../main/java/org/apache/doris/httpv2/rest/MetricsAction.java | 4 ++--
.../java/org/apache/doris/httpv2/rest/TableQueryPlanAction.java | 9 +++++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetricsAction.java
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetricsAction.java
index 1581c28a317..d7eb61d335b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetricsAction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetricsAction.java
@@ -27,7 +27,7 @@ import org.apache.doris.metric.SimpleCoreMetricVisitor;
import com.google.common.base.Strings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
@@ -41,7 +41,7 @@ public class MetricsAction extends RestBaseController {
private static final Logger LOG =
LogManager.getLogger(MetricsAction.class);
private static final String TYPE_PARAM = "type";
- @RequestMapping(path = "/metrics")
+ @GetMapping(path = "/metrics")
public void execute(HttpServletRequest request, HttpServletResponse
response) {
if (Config.enable_all_http_auth) {
executeCheckPassword(request, response);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/TableQueryPlanAction.java
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/TableQueryPlanAction.java
index 6a34322f0e0..f3379355708 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/TableQueryPlanAction.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/TableQueryPlanAction.java
@@ -25,6 +25,7 @@ import org.apache.doris.analysis.TableRef;
import org.apache.doris.catalog.Database;
import org.apache.doris.catalog.Env;
import org.apache.doris.catalog.Table;
+import org.apache.doris.catalog.TableIf;
import org.apache.doris.common.DorisHttpException;
import org.apache.doris.common.MetaNotFoundException;
import org.apache.doris.httpv2.entity.ResponseEntityBuilder;
@@ -116,7 +117,7 @@ public class TableQueryPlanAction extends
RestBaseController {
Table table;
try {
Database db =
Env.getCurrentInternalCatalog().getDbOrMetaException(fullDbName);
- table = db.getTableOrMetaException(tblName,
Table.TableType.OLAP);
+ table = db.getTableOrMetaException(tblName,
TableIf.TableType.OLAP);
} catch (MetaNotFoundException e) {
return ResponseEntityBuilder.okWithCommonError(e.getMessage());
}
@@ -149,13 +150,13 @@ public class TableQueryPlanAction extends
RestBaseController {
* process the sql syntax and return the resolved pruned tablet
*
* @param context context for analyzer
- * @param sql the single table select statement
- * @param result the acquired results
+ * @param sql the single table select statement
+ * @param result the acquired results
* @return
* @throws DorisHttpException
*/
private void handleQuery(ConnectContext context, String requestDb, String
requestTable, String sql,
- Map<String, Object> result) throws
DorisHttpException {
+ Map<String, Object> result) throws DorisHttpException {
// use SE to resolve sql
StmtExecutor stmtExecutor = new StmtExecutor(context, new
OriginStatement(sql, 0), false);
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]