summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httpconnectd.sh.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/httpconnectd.sh.in b/httpconnectd.sh.in
index 36303bb..bcbdb1d 100644
--- a/httpconnectd.sh.in
+++ b/httpconnectd.sh.in
@@ -19,38 +19,50 @@ OK() {
}
Forbidden() {
+ body='403 Forbidden'
printf '%s\r\n' \
'HTTP/1.1 403 Forbidden' \
"Server: $server" \
"Date: $(date -R)" \
'Allow: CONNECT' \
+ "Content-Length: ${#body}" \
''
+ printf '%s' "$body"
}
MethodNotAllowed() {
+ body='405 Method Not Allowed'
printf '%s\r\n' \
'HTTP/1.1 405 Method Not Allowed' \
"Server: $server" \
"Date: $(date -R)" \
'Allow: CONNECT' \
+ "Content-Length: ${#body}" \
''
+ printf '%s' "$body"
}
ProxyAuthenticationRequired() {
+ body='407 Proxy Authentication Required'
printf '%s\r\n' \
'HTTP/1.1 407 Proxy Authentication Required' \
"Server: $server" \
"Date: $(date -R)" \
"Proxy-Authenticate: $(echo $(declare -F|sed -n 's/^declare -f authenticate_//p')|sed 's/ /, /g')" \
+ "Content-Length: ${#body}" \
''
+ printf '%s' "$body"
}
InternalServerError() {
+ body='500 Internal Server Error'
printf '%s\r\n' \
'HTTP/1.1 500 Internal Server Error' \
"Server: $server" \
"Date: $(date -R)" \
+ "Content-Length: ${#body}" \
''
+ printf '%s' "$body"
}
checkdest() {