From 13a08c508005b9c3b280c05459e943a268b5ccc5 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 6 May 2021 11:47:53 -0400 Subject: Fixed static file handler to allow subdirectories properly. Fixed directory file listing under Linux. Release listing now works through CGI. --- captain/web.f90 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'captain/web.f90') diff --git a/captain/web.f90 b/captain/web.f90 index ec91d88..e466c63 100644 --- a/captain/web.f90 +++ b/captain/web.f90 @@ -84,6 +84,9 @@ contains if(.not. associated(req%query_string)) then public_path = "/releases" local_path = release_dir + else if(len_trim(req%query_string) == 0) then + public_path = "/releases" + local_path = release_dir else call combine_paths("/releases", req%query_string, public_path) call combine_paths(release_dir, req%query_string, local_path) @@ -115,9 +118,9 @@ contains if(trim(public_path) /= "/releases") then i = index(req%query_string, "/", back=.true.) if(i > 0) then - one_link = html_link("/releases.html?"//req%query_string(1:(i-1)), "Up a directory") + one_link => html_link("releases.html?"//req%query_string(1:(i-1)), "Up a directory") else - one_link = html_link("/releases.html", "Up a directory") + one_link => html_link("releases.html", "Up a directory") end if res = trim(res)//nl//"
  • "//one_link//"
  • " deallocate(one_link) @@ -133,7 +136,7 @@ contains subpath = trim(directories(i)) end if - one_link = html_link("/releases.html?"//trim(subpath), folder_icon//" "//trim(directories(i))) + one_link => html_link("releases.html?"//trim(subpath), folder_icon//" "//trim(directories(i))) res = trim(res)//nl//"
  • "//one_link//"
  • " deallocate(one_link) @@ -146,8 +149,8 @@ contains if(associated(files)) then do i = 1, size(files) - call combine_paths(public_path, trim(files(i)), subpath) - one_link = html_link("/releases.html?"//trim(subpath), trim(files(i))) + call combine_paths(public_path(2:len_trim(public_path)), trim(files(i)), subpath) + one_link => html_link(trim(subpath), trim(files(i))) res = trim(res)//nl//"
  • "//one_link//"
  • " deallocate(one_link) end do -- cgit v1.2.3