Skip to content

Instantly share code, notes, and snippets.

@dam2k
Last active February 19, 2021 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dam2k/de1e5a4335f21cca57e8cae980009778 to your computer and use it in GitHub Desktop.
Save dam2k/de1e5a4335f21cca57e8cae980009778 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Apache HTTPD sends STDOUT produced by this script straight to the browser. OK???
# First we send HTTP Response headers, one header per line, each header line terminates with \n.
# A lonly \n character (an empty line) will separate headers from body.
# The HTTP Response body stream will then follow.
# Send Content-Type HTTP response Header to stdout (straight to the browser)
printf 'Content-Type: %s\n' 'text/plain'
# Send HTTP/410
printf 'Status: %s\n' '410 Gone'
# End of HTTP Headers
printf '\n'
# Send HTTP Body to the browser
printf 'Hello world\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment