!htc Remove obsolete ProtectedHeaderCreation construct
This commit is contained in:
parent
82d4963382
commit
a2cf6cf228
1 changed files with 2 additions and 11 deletions
|
|
@ -6,19 +6,10 @@ package akka.http.model
|
|||
package headers
|
||||
|
||||
import java.net.InetSocketAddress
|
||||
import scala.annotation.{ tailrec, implicitNotFound }
|
||||
import scala.annotation.tailrec
|
||||
import scala.collection.immutable
|
||||
import akka.http.util._
|
||||
|
||||
object ProtectedHeaderCreation {
|
||||
@implicitNotFound("Headers of this type are managed automatically by akka-http-core. If you are sure that creating " +
|
||||
"instances manually is required in your use case `import HttpHeaders.ProtectedHeaderCreation.enable` to override " +
|
||||
"this warning.")
|
||||
sealed trait Enabled
|
||||
implicit def enable: Enabled = null
|
||||
}
|
||||
import ProtectedHeaderCreation.enable
|
||||
|
||||
sealed abstract class ModeledCompanion extends Renderable {
|
||||
val name = getClass.getSimpleName.replace("$minus", "-").dropRight(1) // trailing $
|
||||
val lowercaseName = name.toRootLowerCase
|
||||
|
|
@ -60,7 +51,7 @@ object `Content-Length` extends ModeledCompanion
|
|||
* Instances of this class will only be created transiently during header parsing and will never appear
|
||||
* in HttpMessage.header. To access the Content-Length, see subclasses of HttpEntity.
|
||||
*/
|
||||
final case class `Content-Length` private[http] (length: Long)(implicit ev: ProtectedHeaderCreation.Enabled) extends ModeledHeader {
|
||||
final case class `Content-Length` private[http] (length: Long) extends ModeledHeader {
|
||||
def renderValue[R <: Rendering](r: R): r.type = r ~~ length
|
||||
protected def companion = `Content-Length`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue