aboutsummaryrefslogtreecommitdiff
path: root/captain/special.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-12 10:32:39 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-12 10:32:39 -0400
commitfca71fde0161a59ac650bd690a3413ffd866662d (patch)
tree72b1e6040f0b2401c358d54e1bdec9f0724a7d41 /captain/special.f90
parent025b5d1dcbb30e727afee3307d49328432bae603 (diff)
downloadlevitating-fca71fde0161a59ac650bd690a3413ffd866662d.tar.gz
levitating-fca71fde0161a59ac650bd690a3413ffd866662d.zip
URLs in instructions can now leave out the server implying download and upload from the server itself. Download and upload both work correctly.
Diffstat (limited to 'captain/special.f90')
-rw-r--r--captain/special.f9027
1 files changed, 27 insertions, 0 deletions
diff --git a/captain/special.f90 b/captain/special.f90
index 43a4a6a..9adbb75 100644
--- a/captain/special.f90
+++ b/captain/special.f90
@@ -6,12 +6,16 @@ contains
function get_special_full_filename(category, filename) result(res)
use utilities, only: combine_paths
use config
+ use logging
implicit none
character(*), intent(in)::category, filename
character(len=:), pointer::res
res => null()
+
+ call write_log("category: "//trim(category))
+ call write_log("file: "//trim(filename))
if(trim(category) == "releases") then
allocate(character(len=(len_trim(release_dir)+len_trim(filename)+1)) :: res)
@@ -33,6 +37,8 @@ contains
call combine_paths(instructions_dir, filename, res)
end if
+ call write_log("path: "//trim(res))
+
end function get_special_full_filename
function get_instructions_static_filename(instruction_id) result(res)
@@ -80,4 +86,25 @@ contains
end function get_task_result_static_filename
+ function get_full_filename_from_request(req) result(res)
+ use server_response
+ implicit none
+
+ class(request)::req
+ character(len=:), pointer::res
+
+ character(256)::first
+ character(1024)::remaining
+ integer::i
+
+ call req%path_component(1, first)
+
+ i = index(req%location, trim(first))
+ i = i + len_trim(first) + 1
+ remaining = req%location(i:len_trim(req%location))
+
+ res => get_special_full_filename(first, trim(remaining))
+
+ end function get_full_filename_from_request
+
end module special_filenames