Last active
February 19, 2021 10:29
-
-
Save dam2k/de1e5a4335f21cca57e8cae980009778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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