Plan 9 from Bell Labs’s /usr/web/sources/contrib/maht/httpd/magic/httpd_headers

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



fn 200ok {
	echo HTTP/1.1 200 OK
	http_common
}

fn poweredby {
	echo X-Powered-By: Plan 9 From Bell Labs
}

fn server {
	echo Server: ip/httpd/httpd magic
}

fn http_common {
	poweredby
	server
	datestamp
}

fn plain {
	echo Content-Type: text/plain
}

fn pdf {
	echo Content-Type: application/pdf
}

fn html {
	echo Content-Type: text/html
}

fn length {
	s = `{ls -l $1}
	echo 'Content-Length: ' ^$s(6)
}

fn datestamp {
	d = `{date}
	echo Date: $d(1) ^, $d(3) $d(2) $d(6) $d(4) $d(5)
}

fn filename {
	echo 'Content-Disposition: attachment; filename="' ^$1 ^'"'
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.