Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down