fix corss payload method xss
@@ -3,6 +3,8 @@ package com.dianping.cat.report.page.cross;
import org.unidal.web.mvc.ActionContext;
import org.unidal.web.mvc.payload.annotation.FieldMeta;
+import java.net.URLEncoder;
+
import com.dianping.cat.mvc.AbstractReportPayload;
import com.dianping.cat.report.ReportPage;
@@ -60,6 +62,14 @@ public class Payload extends AbstractReportPayload<Action, ReportPage> {
return m_method;
}
+ public String getEncodedMethod() {
+ try {
+ return URLEncoder.encode(m_method, "utf-8");
+ } catch (Exception e) {
+ return m_method;
+ }
+ }
+
@Override
public ReportPage getPage() {
return m_page;
