[
https://issues.apache.org/jira/browse/SCB-897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16606242#comment-16606242
]
ASF GitHub Bot commented on SCB-897:
------------------------------------
wujimin commented on a change in pull request #895: [SCB-897] Support max
initial line length config
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/895#discussion_r215734665
##########
File path:
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestRestServerConfig.java
##########
@@ -0,0 +1,65 @@
+/*
+ * 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.servicecomb.it.testcase.base;
+
+import org.apache.servicecomb.it.Consumers;
+import org.apache.servicecomb.it.junit.ITJUnitUtils;
+import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class TestRestServerConfig {
+ interface RestServerConfigSchemaIntf {
+ String testMaxInitialLineLength(String q);
+ }
+
+ static Consumers<RestServerConfigSchemaIntf> consumers = new
Consumers<>("restServerConfig",
+ RestServerConfigSchemaIntf.class);
+
+ @BeforeClass
+ public static void classSetup() {
+ consumers.init(ITJUnitUtils.getTransport());
+ }
+
+ @Test
+ public void testMaxInitialLineLength_underLimit() {
+ String querySegment = "1234567890";
+ StringBuilder q = new StringBuilder();
+ while (q.length() < 4900) {
+ q.append(querySegment);
+ }
+ String result = consumers.getIntf().testMaxInitialLineLength(q.toString());
+ Assert.assertEquals("OK", result);
+ }
+
+ @Test
+ public void testMaxInitialLineLength_exceedLimit() {
Review comment:
test 4999 and 5000?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Support config rest server max initial line length
> --------------------------------------------------
>
> Key: SCB-897
> URL: https://issues.apache.org/jira/browse/SCB-897
> Project: Apache ServiceComb
> Issue Type: Improvement
> Reporter: YaoHaishi
> Assignee: YaoHaishi
> Priority: Major
>
> Currently the http request first line length is limited to 4096 on provider
> side.
> We need to provide a config item for user to specify it.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)