All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.touk.nussknacker.ui.util.AkkaHttpResponse.scala Maven / Gradle / Ivy

There is a newer version: 1.17.0
Show newest version
package pl.touk.nussknacker.ui.util

import akka.http.scaladsl.model.headers.ContentDispositionTypes
import akka.http.scaladsl.model.{HttpResponse, ResponseEntity, StatusCodes, headers}

object AkkaHttpResponse {

  def asFile(entity: ResponseEntity, fileName: String) = {
    HttpResponse(
      status = StatusCodes.OK,
      entity = entity,
      headers = List(headers.`Content-Disposition`(ContentDispositionTypes.attachment, Map("filename" -> fileName)))
    )
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy