On Fri, Feb 21, 2025 at 4:08 PM Christopher Schultz <ch...@christopherschultz.net> wrote: > > Rémy, > > On 2/20/25 12:58 PM, r...@apache.org wrote: > > This is an automated email from the ASF dual-hosted git repository. > > > > remm pushed a commit to branch main > > in repository https://gitbox.apache.org/repos/asf/tomcat.git > > > > > > The following commit(s) were added to refs/heads/main by this push: > > new 2eb8e19552 Update with transfer-encoding support > > 2eb8e19552 is described below > > > > commit 2eb8e19552ec78cc922cba2f1cbd05940e8b6951 > > Author: remm <r...@apache.org> > > AuthorDate: Thu Feb 20 18:57:39 2025 +0100 > > > > Update with transfer-encoding support > > > > Although there is no client browser support, and there may never be > > any, > > Transfer-Encoding is the right way to do compression the way Tomcat > > does > > it in GzipOutputFilter. > > This will be used if the client sends a TE: gzip header. > > --- > > java/org/apache/coyote/CompressionConfig.java | 75 > > ++++++++++++++------ > > java/org/apache/tomcat/util/http/parser/TE.java | 84 > > +++++++++++++++++++++++ > > test/org/apache/coyote/TestCompressionConfig.java | 59 ++++++++++++---- > > webapps/docs/changelog.xml | 5 ++ > > 4 files changed, 189 insertions(+), 34 deletions(-) > > > > > > [snip] > > > > > > diff --git a/java/org/apache/tomcat/util/http/parser/TE.java > > b/java/org/apache/tomcat/util/http/parser/TE.java > > new file mode 100644 > > index 0000000000..b2792448fa > > --- /dev/null > > +++ b/java/org/apache/tomcat/util/http/parser/TE.java > > @@ -0,0 +1,84 @@ > > +/* > > + * 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.tomcat.util.http.parser; > > + > > +import java.io.IOException; > > +import java.io.StringReader; > > +import java.util.ArrayList; > > +import java.util.HashMap; > > +import java.util.List; > > +import java.util.Map; > > + > > +public class TE { > > + > > + private final String encoding; > > + private final Map<String,String> parameters; > > + > > + protected TE(String encoding, Map<String,String> parameters) { > > + this.encoding = encoding; > > + this.parameters = parameters; > > + } > > + > > This seems like it would be very reusable if not for the name of the > class. For example, AcceptEncoding, AcceptLanguage, TE, etc. all seem to > have very related structure and unrelated implementations. > > Do you think it's worth looking for refactoring opportunities, here, or > is just code-churn? > > I'd be happy to give it a try myself... I'm not looking to create work > for you :)
The common code is already in HttpParser, so this looks good to me. Although similar, the headers are all a bit different. Rémy > -chris > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org