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

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

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

import org.typelevel.ci._
import akka.http.scaladsl.model.headers.RawHeader
import akka.http.scaladsl.server.Directive0
import akka.http.scaladsl.server.Directives.respondWithHeaders

object SecurityHeadersSupport {

  val headers = List(
    (ci"X-Content-Type-Options", "nosniff"),
    (ci"Referrer-Policy", "no-referrer")
  )

  private val rawHeaders = headers.map { case (name, value) => RawHeader(name.toString, value) }

  def apply(): Directive0 = respondWithHeaders(rawHeaders)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy