def this()

in server/src/main/scala/com/twitter/server/handler/AdminRedirectHandler.scala [14:31]


  def this() = this(None)
  def this(pathMatcher: String => Boolean) = this(Some(pathMatcher))

  private[this] def mkResponse(status: Status): Future[Response] =
    newResponse(
      status = status,
      contentType = "text/plain;charset=UTF-8",
      content = Buf.Empty,
      headers = Seq((Fields.Location, URI.create(Path.Admin)))
    )

  def apply(req: Request): Future[Response] = pathMatcher match {
    case Some(pred) =>
      if (pred(req.path)) mkResponse(Status.TemporaryRedirect)
      else mkResponse(Status.NotFound)
    case None =>
      mkResponse(Status.TemporaryRedirect)
  }