This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch 1.3.x
in repository https://gitbox.apache.org/repos/asf/pekko-http.git


The following commit(s) were added to refs/heads/1.3.x by this push:
     new ef2a12e72 deprecate withRemoteAddressHeader (#758)
ef2a12e72 is described below

commit ef2a12e7218a1578e3f12959276b504a7423438c
Author: PJ Fanning <[email protected]>
AuthorDate: Thu Sep 11 11:22:12 2025 +0100

    deprecate withRemoteAddressHeader (#758)
    
    * deprecate withRemoteAddressHeader
    
    * build issues
---
 .../org/apache/pekko/http/javadsl/settings/ServerSettings.scala     | 6 ++++++
 .../org/apache/pekko/http/scaladsl/settings/ServerSettings.scala    | 6 ++++++
 .../org/apache/pekko/http/impl/engine/server/HttpServerSpec.scala   | 1 +
 .../scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala     | 1 +
 .../pekko/http/scaladsl/settings/PreviewServerSettingsSpec.scala    | 1 +
 5 files changed, 15 insertions(+)

diff --git 
a/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
 
b/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
index d5bbdf98b..ef0256cdd 100644
--- 
a/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
+++ 
b/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
@@ -76,6 +76,12 @@ import scala.concurrent.duration.{ Duration, FiniteDuration }
   def withTimeouts(newValue: ServerSettings.Timeouts): ServerSettings = 
self.copy(timeouts = newValue.asScala)
   def withMaxConnections(newValue: Int): ServerSettings = 
self.copy(maxConnections = newValue)
   def withPipeliningLimit(newValue: Int): ServerSettings = 
self.copy(pipeliningLimit = newValue)
+
+  /**
+   * @deprecated since Pekko HTTP 1.3.0, use withRemoteAddressAttribute instead
+   */
+  @Deprecated
+  @deprecated("Use withRemoteAddressAttribute instead", since = "1.3.0")
   def withRemoteAddressHeader(newValue: Boolean): ServerSettings = 
self.copy(remoteAddressHeader = newValue)
   def withRemoteAddressAttribute(newValue: Boolean): ServerSettings = 
self.copy(remoteAddressAttribute = newValue)
   def withRawRequestUriHeader(newValue: Boolean): ServerSettings = 
self.copy(rawRequestUriHeader = newValue)
diff --git 
a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
 
b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
index 8361d4b8a..7d449353c 100644
--- 
a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
+++ 
b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
@@ -105,6 +105,12 @@ abstract class ServerSettings private[pekko] () extends 
pekko.http.javadsl.setti
     self.copy(previewServerSettings = newValue)
   override def withMaxConnections(newValue: Int): ServerSettings = 
self.copy(maxConnections = newValue)
   override def withPipeliningLimit(newValue: Int): ServerSettings = 
self.copy(pipeliningLimit = newValue)
+
+  /**
+   * @deprecated since Pekko HTTP 1.3.0, use withRemoteAddressAttribute instead
+   */
+  @Deprecated
+  @deprecated("Use withRemoteAddressAttribute instead", since = "1.3.0")
   override def withRemoteAddressHeader(newValue: Boolean): ServerSettings = 
self.copy(remoteAddressHeader = newValue)
   override def withRemoteAddressAttribute(newValue: Boolean): ServerSettings =
     self.copy(remoteAddressAttribute = newValue)
diff --git 
a/http-core/src/test/scala/org/apache/pekko/http/impl/engine/server/HttpServerSpec.scala
 
b/http-core/src/test/scala/org/apache/pekko/http/impl/engine/server/HttpServerSpec.scala
index 893973e8d..62417f021 100644
--- 
a/http-core/src/test/scala/org/apache/pekko/http/impl/engine/server/HttpServerSpec.scala
+++ 
b/http-core/src/test/scala/org/apache/pekko/http/impl/engine/server/HttpServerSpec.scala
@@ -1168,6 +1168,7 @@ class HttpServerSpec extends PekkoSpec(
       // coverage for #21130
       lazy val theAddress = InetAddress.getByName("127.5.2.1")
 
+      @nowarn("msg=deprecated")
       override def settings: ServerSettings =
         super.settings.withRemoteAddressHeader(true)
 
diff --git 
a/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
 
b/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
index 66fccacf5..cceed03ba 100644
--- 
a/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
+++ 
b/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
@@ -221,6 +221,7 @@ abstract class ClientServerSpecBase(http2: Boolean) extends 
PekkoSpecWithMateria
       }
 
       abstract class RemoteAddressTestScenario {
+        @nowarn("msg=deprecated")
         val settings = ServerSettings(system).withRemoteAddressHeader(true)
         def createBinding(): Future[ServerBinding]
 
diff --git 
a/http-core/src/test/scala/org/apache/pekko/http/scaladsl/settings/PreviewServerSettingsSpec.scala
 
b/http-core/src/test/scala/org/apache/pekko/http/scaladsl/settings/PreviewServerSettingsSpec.scala
index d3494d350..35d7a5b23 100644
--- 
a/http-core/src/test/scala/org/apache/pekko/http/scaladsl/settings/PreviewServerSettingsSpec.scala
+++ 
b/http-core/src/test/scala/org/apache/pekko/http/scaladsl/settings/PreviewServerSettingsSpec.scala
@@ -15,6 +15,7 @@ package org.apache.pekko.http.scaladsl.settings
 
 import org.apache.pekko.testkit.PekkoSpec
 
[email protected]("msg=deprecated")
 class PreviewServerSettingsSpec extends PekkoSpec {
 
   def compileOnlySpec(body: => Unit) = ()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to