diff --git a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpMethods.java b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpMethods.java index 808a6c1ad..87bffddea 100644 --- a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpMethods.java +++ b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpMethods.java @@ -34,27 +34,6 @@ private HttpMethods() {} public static final HttpMethod QUERY = org.apache.pekko.http.scaladsl.model.HttpMethods.QUERY(); public static final HttpMethod TRACE = org.apache.pekko.http.scaladsl.model.HttpMethods.TRACE(); - /** - * Create a custom method type. - * - * @deprecated The created method will compute the presence of Content-Length headers based on - * deprecated logic, use {@link #custom(String, boolean, boolean, - * org.apache.pekko.http.javadsl.model.RequestEntityAcceptance, boolean)} instead. Deprecated - * since 1.4.0. - */ - @Deprecated(since = "1.4.0") - public static HttpMethod custom( - String value, - boolean safe, - boolean idempotent, - org.apache.pekko.http.javadsl.model.RequestEntityAcceptance requestEntityAcceptance) { - // This cast is safe as implementation of RequestEntityAcceptance only exists in Scala - org.apache.pekko.http.scaladsl.model.RequestEntityAcceptance scalaRequestEntityAcceptance = - (org.apache.pekko.http.scaladsl.model.RequestEntityAcceptance) requestEntityAcceptance; - return org.apache.pekko.http.scaladsl.model.HttpMethod.custom( - value, safe, idempotent, scalaRequestEntityAcceptance); - } - /** * Create a custom method type. * diff --git a/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes index a9beb95c1..efeb349cf 100644 --- a/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes +++ b/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes @@ -126,6 +126,9 @@ ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scalad ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ServerSettings.getWebsocketRandomFactory") ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ServerSettings.withWebsocketRandomFactory") +# Remove deprecated HttpMethod.custom 4-arg (since 1.4.0) +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpMethod.custom") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.model.HttpMethods.custom") # Remove deprecated ParserSettings.apply/create (since Akka HTTP 10.2.0) ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ParserSettings.apply") ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ParserSettings.default") diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMethod.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMethod.scala index d40798624..85655e3dd 100644 --- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMethod.scala +++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMethod.scala @@ -55,21 +55,6 @@ final case class HttpMethod private[http] ( object HttpMethod { - // the allowsEntity condition was used to determine what responses provided the Content-Length header, before the fix - private def oldContentLengthCondition(status: StatusCode) = status.allowsEntity - - /** - * Create a custom method type. - * @deprecated The created method will compute the presence of Content-Length headers based on deprecated logic. - */ - @deprecated("Use the overload with contentLengthAllowed parameter", since = "1.4.0") - def custom(name: String, safe: Boolean, idempotent: Boolean, requestEntityAcceptance: RequestEntityAcceptance) - : HttpMethod = { - require(name.nonEmpty, "value must be non-empty") - require(!safe || idempotent, "An HTTP method cannot be safe without being idempotent") - apply(name, safe, idempotent, requestEntityAcceptance, oldContentLengthCondition) - } - /** * Create a custom method type. */