Add REST path for getting mailbox contents - postreich - Unnamed repository; edit this file 'description' to name the repository. (DIR) Log (DIR) Files (DIR) Refs (DIR) README --- (DIR) commit 08b37b9c8f797be4ceb7ad8b0fcbe3f59e84fad2 (DIR) parent 35308b688d43b72fc2cf757f5c37978212027cac (HTM) Author: Scarlett McAllister <no+reply@roygbyte.com> Date: Sat, 20 Jan 2024 18:57:40 -0400 Add REST path for getting mailbox contents Diffstat: M geomyidae/postoffice/index.cgi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- (DIR) diff --git a/geomyidae/postoffice/index.cgi b/geomyidae/postoffice/index.cgi @@ -1,4 +1,5 @@ #!/bin/sh + . ./common path=$( sanitize_restful_path "$TRAVERSAL" ) @@ -6,10 +7,13 @@ args="$2" case "$path" in /mailbox/create/*) - handle=$( printf "%s" "$path" \ - | awk -F/ '{ print $4 }' ) + handle=$( find_handle_in_path "$path" ) ./create-mailbox "$handle" "$args" - ;; + ;; + /mailbox/get/*) + handle=$( find_handle_in_path "$path" ) + ./get-mailbox -c "$handle" + ;; esac