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

rcumflex.circumflex-web.3.0-RC1.source-code.xsendfile.scala Maven / Gradle / Ivy

Go to download

Lightweight framework for quick and robust application development using Scala programming language.

The newest version!
package pro.savant.circumflex
package web
import java.io.File

/*!# X-SendFile feature

Most modern web servers provide the `X-SendFile` feature: they take control over
the process of sending a file to the client. Your application, for example, may
check permissions, set some headers, like `Content-Disposition`, and then delegate
the hard stuff to web server.

Refer to the documentation of your favorite web server for more information.
 */
trait XSendFileHeader {
  def name: String
  def value(f: File): String
}

object DefaultXSendFileHeader extends XSendFileHeader {
  def name = "X-SendFile"
  def value(f: File): String = f.getAbsolutePath
}

trait NginxXSendFileHeader extends XSendFileHeader {
  def name = "X-Accel-Redirect"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy