@@ -56,7 +56,7 @@ public RequestHolder build(FullHttpRequest originRequest) throws Exception {
5656 if (route == null ) {
5757 throw new GatewayNoRouteException ();
5858 }
59- URL url = route .getMapUrl ();
59+ URL url = route .getMapUrl ();
6060 logger .info ("proxy_pass {}" , url .toString ());
6161
6262 // 请求路径
@@ -80,7 +80,7 @@ public RequestHolder build(FullHttpRequest originRequest) throws Exception {
8080 if (contentType .startsWith (HttpHeaderValues .APPLICATION_JSON .toString ())) {
8181 ByteBuf bbuf = Unpooled .copiedBuffer (buildContentJson (route ), StandardCharsets .UTF_8 );
8282 newRequest .headers ().set (HttpHeaderNames .CONTENT_LENGTH , bbuf .readableBytes ());
83- ((FullHttpRequest )newRequest ).content ().writeBytes (bbuf );
83+ ((FullHttpRequest ) newRequest ).content ().writeBytes (bbuf );
8484 } else if (contentType .startsWith (HttpHeaderValues .APPLICATION_X_WWW_FORM_URLENCODED .toString ())) {
8585 HttpPostRequestEncoder requestEncoder = new HttpPostRequestEncoder (newRequest , false );
8686 buildContentFormUrlEncoded (route ).forEach ((key , values ) -> {
@@ -107,14 +107,15 @@ public RequestHolder build(FullHttpRequest originRequest) throws Exception {
107107 } else {
108108 ByteBuf byteBuf = buildContentOther (route );
109109 newRequest .headers ().set (HttpHeaderNames .CONTENT_LENGTH , byteBuf .readableBytes ());
110- ((FullHttpRequest )newRequest ).content ().writeBytes (byteBuf );
110+ ((FullHttpRequest ) newRequest ).content ().writeBytes (byteBuf );
111111 }
112112 }
113113 return new RequestHolder (route , url , newRequest , newBodyRequestEncoder );
114114 }
115115
116116 /**
117117 * 返回path(不包含?后面的参数部分)
118+ *
118119 * @return
119120 */
120121 protected String buildPath (Route route ) {
@@ -123,6 +124,7 @@ protected String buildPath(Route route) {
123124
124125 /**
125126 * 返回请求的请求参数
127+ *
126128 * @return
127129 */
128130 protected Map <String , List <String >> buildParams (Route route ) {
@@ -131,6 +133,7 @@ protected Map<String, List<String>> buildParams(Route route) {
131133
132134 /**
133135 * 返回请求的请求头
136+ *
134137 * @return
135138 */
136139 protected Map <String , List <String >> buildHeaders (Route route ) {
@@ -139,6 +142,7 @@ protected Map<String, List<String>> buildHeaders(Route route) {
139142
140143 /**
141144 * 如果content-type为application/json,获取请求体
145+ *
142146 * @return
143147 */
144148 protected String buildContentJson (Route route ) {
@@ -147,6 +151,7 @@ protected String buildContentJson(Route route) {
147151
148152 /**
149153 * 如果content-type为application/x-www-form-urlencoded,获取请求体
154+ *
150155 * @return
151156 */
152157 protected Map <String , List <String >> buildContentFormUrlEncoded (Route route ) {
@@ -155,6 +160,7 @@ protected Map<String, List<String>> buildContentFormUrlEncoded(Route route) {
155160
156161 /**
157162 * 如果content-type为multipart/form-data,获取请求体
163+ *
158164 * @return
159165 */
160166 protected List <InterfaceHttpData > buildContentFormData (Route route ) {
@@ -163,6 +169,7 @@ protected List<InterfaceHttpData> buildContentFormData(Route route) {
163169
164170 /**
165171 * 其他类型的content-type则直接返回相应的ByteBuf
172+ *
166173 * @return
167174 */
168175 private ByteBuf buildContentOther (Route route ) {
0 commit comments