X-Git-Url: http://git.plutz.net/?p=clickslide;a=blobdiff_plain;f=cgilite.sh;h=1f2ebb3c9e03177d26e84a096d5c71243b00aefb;hp=46866266ea6f3250dd86106a00537a721da0a37f;hb=44d80696c763f4e8c8102ea8d8c570e686fbff4e;hpb=a96b0fcd8fb4afad4e169a3929270e2335cf4d0d diff --git a/cgilite.sh b/cgilite.sh index 4686626..1f2ebb3 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -172,18 +172,21 @@ SET_COOKIE(){ case "$1" in ''|0|session) expire='';; [+-][0-9]*) expire="$(date -R -d @$(($(date +%s) + $1)))";; - *) expire="$(date -R -d "$1")";; + *) expire="$(date -R -d "$1")";; esac cookie="$2" - + printf 'Set-Cookie: %s' "$cookie" - [ -n "$expire" ] && printf '; Expires=%s' "$expire" + [ -n "$expire" ] && printf '; Expires=%s' "${expire%+????}${expire:+GMT}" [ $# -ge 3 ] && shift 2 && printf '; %s' "$@" printf '\r\n' } REDIRECT(){ - printf 'Status: 303 See Other\r\nLocation: %s\r\n\r\n' "$*" + printf '%s: %s\r\n' + Status "303 See Other" \ + Content-Length 0 \ + Location "$*" + printf '\r\n' exit 0 } -