X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=cards%2Fexport_card.sh;h=def0b2dbbf6f06ba03b5832a39f1674304e5c6cb;hb=638d268ba4eff001614d065396572a6d1c03efae;hp=d6ea2937304bb0ffeae647358546a309db429d56;hpb=1b5fe5ec8e6ceb580ada4e0ff4fe3955c2457ec0;p=lobster diff --git a/cards/export_card.sh b/cards/export_card.sh index d6ea293..def0b2d 100755 --- a/cards/export_card.sh +++ b/cards/export_card.sh @@ -17,6 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -echo -n "Content-Type: text/vcard;charset=utf-8\n\n" -card="${_GET[card]}" -cat "$_DATA/vcard/$card" +card="$(GET card |PATH)" +cardfile="$_DATA/vcard/${card##*/}" + +if [ -f "$cardfile" ]; then + . $_EXEC/cgilite/file.sh + FILE "$cardfile" "text/vcard/charset=utf-8" +else + printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n' +fi