You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "NavidJalali (via GitHub)" <gi...@apache.org> on 2025/05/28 14:15:30 UTC

[PR] Add trailer header [pekko-http]

NavidJalali opened a new pull request, #684:
URL: https://github.com/apache/pekko-http/pull/684

   According to https://datatracker.ietf.org/doc/html/rfc7230#section-4.4
   Introduced to pekko-grpc but moving it here
   https://github.com/apache/pekko-grpc/pull/456#discussion_r2109260332


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "jrudolph (via GitHub)" <gi...@apache.org>.
jrudolph commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2922429986

   I'd try to keep it generic and not invent new names, either keep calling it `Trailer` or use `TrailerHeader`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2917482361

   > The naming clash between this and the other class named Trailer is somewhat annoying, and enclosing the class name in backticks actually doesnt make any difference, they would still collide, I am open to suggestions for a different name tho
   
   Is there anyway that https://github.com/apache/pekko-http/blob/887c2175a92c703cb3349450228aa101912b987c/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/Trailer.scala#L22 could be extended to support what you are doing here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2920533222

   > Calling the class `Trailer` is ok if this is the easiest way to go. We can always alias the class in the import statements if we need to differentiate it from the existing Trailer class.
   > 
   > ```
   > import org.apache.pekko.http.javadsl.model.headers.{Trailer => TrailerHint}
   > ```
   
   Yeah that would work in scala, I haven't really written a ton of Java but I think it doesnt have import renames 😞 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2996009202

   > lgtm - will merge and tag the commit to start the 1.3 dev line
   
   Thanks, I will clean up Pekko Http once 1.3 is released


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2917623792

   Sure TrailerHeader is not as good as some of the alternatives. I like TrailerHint and TrailerFields but TrailerAnnouncement is ok too. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2918667836

   I've hit a little snag, modeled companion class always pre-initializes the name of the header as the name of the class! 
   Even `TE` is rendered as `TE: ???`. If I overwrite it it will cause initialization issues and NPEs
   <img width="856" alt="image" src="https://github.com/user-attachments/assets/325ee0d1-b452-4a74-9c96-acaec21de615" />
   I guess I could solve that by turning that val into a def but its a change in behavior and I am not sure of the performance impacts. Any suggestions?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2939195275

   Since changing the name to TrailerHeader is an invasive change, I'll keep it as is for now. If its not okay then I will have to modify the constructor of ModelCompanion


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2916711506

   The naming clash between this and the other class named Trailer is somewhat annoying, and enclosing the class name in backticks actually doesnt make any difference, they would still collide, I am open to suggestions for a different name tho


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2116031855


##########
http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/headers.scala:
##########
@@ -1226,3 +1225,70 @@ final case class `X-Real-Ip`(address: RemoteAddress) extends jm.headers.XRealIp
   def renderValue[R <: Rendering](r: R): r.type = r ~~ address
   protected def companion = `X-Real-Ip`
 }
+
+object Trailer extends ModeledCompanion[Trailer] {
+  private implicit val trailersRenderer: Renderer[immutable.Iterable[String]] =
+    Renderer.defaultSeqRenderer[String]
+
+  def apply(values: immutable.Seq[String]): Trailer = {
+    val clean = values.map(_.trim).filter(_.nonEmpty)
+    val (forbidden, allowed) = clean.partition(name => isForbidden(name.toRootLowerCase))
+    if (clean.isEmpty)
+      throw new IllegalArgumentException(s"Trailer values must not be empty: No valid header names specified")
+    else if (forbidden.nonEmpty) {
+      val forbiddenInput = forbidden.mkString("[", ", ", "]")
+      throw new IllegalArgumentException(
+        s"Trailer values must not contain forbidden header names: Trailer contained $forbiddenInput")
+    } else new Trailer(allowed)

Review Comment:
   Can you think of a better place to put it?  I only put it here because I didn't know of a better place



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2115915132


##########
http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/headers.scala:
##########
@@ -1226,3 +1225,70 @@ final case class `X-Real-Ip`(address: RemoteAddress) extends jm.headers.XRealIp
   def renderValue[R <: Rendering](r: R): r.type = r ~~ address
   protected def companion = `X-Real-Ip`
 }
+
+object Trailer extends ModeledCompanion[Trailer] {
+  private implicit val trailersRenderer: Renderer[immutable.Iterable[String]] =
+    Renderer.defaultSeqRenderer[String]
+
+  def apply(values: immutable.Seq[String]): Trailer = {
+    val clean = values.map(_.trim).filter(_.nonEmpty)
+    val (forbidden, allowed) = clean.partition(name => isForbidden(name.toRootLowerCase))
+    if (clean.isEmpty)
+      throw new IllegalArgumentException(s"Trailer values must not be empty: No valid header names specified")
+    else if (forbidden.nonEmpty) {
+      val forbiddenInput = forbidden.mkString("[", ", ", "]")
+      throw new IllegalArgumentException(
+        s"Trailer values must not contain forbidden header names: Trailer contained $forbiddenInput")
+    } else new Trailer(allowed)

Review Comment:
   I'm not entirely sure this validation belongs here, but OK I guess.
   
   Could we use an exception type from the `ExceptionWithErrorInfo` hierarchy, that allows splitting the error message 'itself' from the possibly-unsafe 'details'?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2917609830

   > > > The naming clash between this and the other class named Trailer is somewhat annoying, and enclosing the class name in backticks actually doesnt make any difference, they would still collide, I am open to suggestions for a different name tho
   > > 
   > > 
   > > Is there anyway that
   > > https://github.com/apache/pekko-http/blob/887c2175a92c703cb3349450228aa101912b987c/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/Trailer.scala#L22
   > > 
   > > could be extended to support what you are doing here?
   > 
   > Tbh while I'm sure we could make it work I think it would be extra confusing to use the same class for 'the header that announces the trailing headers' and 'the actual trailing headers'.
   > 
   > > If there needs to be 2 separate classes, maybe we could call the new one `TrailerHeader`. It's a bit untidy but its easier to having 2 classes in the same jar with the same class name even if the package differs.
   > 
   > There is precedent for having header classes that have a different name from the name of the header itself: for example, the `TE` class represents the `Transfer-Encoding` header, as `TransferEncoding` was already taken for the encodings 'themselves'. I wonder if we could make it even more descriptive, perhaps `TrailerAnnouncement`? But `TrailerHeader` works for me as well.
   
   I have some suggestions, maybe you can pick one:
   
   How about any of `TrailerHint`, `TrailerFields`, `TrailerDeclaration`? `TrailerHeader` is okay too, it just sounds a bit off to me


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2134730396


##########
http-core/src/test/scala/org/apache/pekko/http/impl/model/parser/HttpHeaderSpec.scala:
##########
@@ -19,7 +19,7 @@ import pekko.http.impl.model.parser.HeaderParser.Settings
 import org.scalatest.matchers.{ MatchResult, Matcher }
 import pekko.http.impl.util._
 import pekko.http.scaladsl.model.{ HttpHeader, _ }
-import headers._
+import headers.{ Trailer => `Trailer`, _ }

Review Comment:
   Hmm, this is creative use of `. Not sure if I like it, but I guess it can't hurt.



##########
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Trailer.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.pekko.http.javadsl.model.headers;
+
+import org.apache.pekko.http.impl.util.Util;
+
+/**
+ * The `Trailer` header is used before a message body to indicate which fields will be present in
+ * the trailers when using chunked transfer encoding. See <a

Review Comment:
   perhaps mention it's also used in HTTP/2?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2917582164

   > > The naming clash between this and the other class named Trailer is somewhat annoying, and enclosing the class name in backticks actually doesnt make any difference, they would still collide, I am open to suggestions for a different name tho
   > 
   > Is there anyway that
   > 
   > https://github.com/apache/pekko-http/blob/887c2175a92c703cb3349450228aa101912b987c/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/Trailer.scala#L22
   > could be extended to support what you are doing here?
   
   Tbh while I'm sure we could make it work I think it would be extra confusing to use the same class for 'the header that announces the trailing headers' and 'the actual trailing headers'.
   
   > If there needs to be 2 separate classes, maybe we could call the new one `TrailerHeader`. It's a bit untidy but its easier to having 2 classes in the same jar with the same class name even if the package differs.
   
   There is precedent for having header classes that have a different name from the name of the header itself: for example, the `TE` class represents the `Transfer-Encoding` header, as `TransferEncoding` was already taken for the encodings 'themselves'. I wonder if we could make it even more descriptive, perhaps `TrailerAnnouncement`? But `TrailerHeader` works for me as well.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2920525557

   Calling the class `Trailer` is ok if this is the easiest way to go. We can always alias the class in the import statements if we need to differentiate it from the existing Trailer class.
   ```
   import org.apache.pekko.http.javadsl.model.headers.{Trailer => TrailerHint}
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2112054936


##########
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Trailer.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.pekko.http.javadsl.model.headers;
+
+import org.apache.pekko.http.impl.util.Util;
+
+public abstract class Trailer extends org.apache.pekko.http.scaladsl.model.HttpHeader {

Review Comment:
   Can you use `@since 1.3.0` on any new public classes or methods? (Javadoc or Scaladoc as appropriate)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2996340483

   Ah Interesting, I thought the versions move in lockstep anyway. I just wanted to make sure I don't leave a mess 😅


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #684:
URL: https://github.com/apache/pekko-http/pull/684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2112056166


##########
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Trailer.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.pekko.http.javadsl.model.headers;
+
+import org.apache.pekko.http.impl.util.Util;
+
+public abstract class Trailer extends org.apache.pekko.http.scaladsl.model.HttpHeader {

Review Comment:
   for a new class wih methods, it is sufficient to just annotate the class



##########
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Trailer.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.pekko.http.javadsl.model.headers;
+
+import org.apache.pekko.http.impl.util.Util;
+
+public abstract class Trailer extends org.apache.pekko.http.scaladsl.model.HttpHeader {

Review Comment:
   for a new class with methods, it is sufficient to just annotate the class



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2112089110


##########
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Trailer.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.pekko.http.javadsl.model.headers;
+
+import org.apache.pekko.http.impl.util.Util;
+
+public abstract class Trailer extends org.apache.pekko.http.scaladsl.model.HttpHeader {

Review Comment:
   In case of a new class, should I just mention it once on top of the class or should I add it to every public method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #684:
URL: https://github.com/apache/pekko-http/pull/684#discussion_r2112089110


##########
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Trailer.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.pekko.http.javadsl.model.headers;
+
+import org.apache.pekko.http.impl.util.Util;
+
+public abstract class Trailer extends org.apache.pekko.http.scaladsl.model.HttpHeader {

Review Comment:
   In case of a new class, should I just mention it once on top of the class or should I add it to every public method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Add trailer header [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #684:
URL: https://github.com/apache/pekko-http/pull/684#issuecomment-2996154266

   @NavidJalali we probably don't want to make pekko-grpc dependent on pekko-http 1.3 (which is what I presume is what you suggesting).
   A little bit of code duplication is no harm if it avoids adding tight dependencies between modules.
   I raised https://github.com/apache/pekko-grpc/issues/470


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org