cookutils rev 778
cooker.cgi: hide poke argument
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Nov 29 19:35:29 2015 +0100 (2015-11-29) |
parents | 4d1e3ab1919e |
children | d8daf2802972 |
files | web/cooker.cgi |
line diff
1.1 --- a/web/cooker.cgi Sun Nov 29 17:50:14 2015 +0100 1.2 +++ b/web/cooker.cgi Sun Nov 29 19:35:29 2015 +0100 1.3 @@ -24,7 +24,15 @@ 1.4 # We're not logged and want time zone to display correct server date. 1.5 export TZ=$(cat /etc/TZ) 1.6 1.7 -if [ "${QUERY_STRING%%=*}" == 'download' ]; then 1.8 +case "$QUERY_STRING" in 1.9 +poke) 1.10 + touch $CACHE/cooker-request 1.11 + cat <<EOT 1.12 +Location: $HTTP_REFERER 1.13 + 1.14 +EOT 1.15 + exit ;; 1.16 +download) 1.17 file=$(busybox httpd -d "$PKGS/${QUERY_STRING#*=}") 1.18 cat <<EOT 1.19 Content-Type: application/octet-stream 1.20 @@ -33,16 +41,21 @@ 1.21 1.22 EOT 1.23 cat "$file" 1.24 - exit 1.25 -fi 1.26 + exit ;; 1.27 +rss) 1.28 + cat <<EOT 1.29 +Content-Type: application/rss+xml 1.30 1.31 -echo -n "Content-Type: " 1.32 -if [ "$QUERY_STRING" == 'rss' ]; then 1.33 - echo 'application/rss+xml' 1.34 -else 1.35 - echo 'text/html; charset=utf-8' 1.36 -fi 1.37 -echo '' 1.38 +EOT 1.39 + ;; 1.40 +*) 1.41 + cat <<EOT 1.42 +Content-Type: text/html; charset=utf-8 1.43 + 1.44 +EOT 1.45 + ;; 1.46 +esac 1.47 + 1.48 1.49 # RSS feed generator 1.50 if [ "$QUERY_STRING" == 'rss' ]; then 1.51 @@ -360,7 +373,6 @@ 1.52 1.53 *) 1.54 case "${QUERY_STRING}" in 1.55 - poke) touch $CACHE/cooker-request ;; 1.56 recook=*) echo ${QUERY_STRING#recook=} >> $CACHE/recook-packages ;; 1.57 esac 1.58 # We may have a toolchain.cgi script for cross cooker's