diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-05-06 11:47:53 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-05-06 11:47:53 -0400 |
commit | 13a08c508005b9c3b280c05459e943a268b5ccc5 (patch) | |
tree | 246029b796ea10d7da11b7032970501bfa605589 /captain/web.f90 | |
parent | b9cac9bb26fe388abff34fa4fc562b0804cabb2e (diff) | |
download | levitating-13a08c508005b9c3b280c05459e943a268b5ccc5.tar.gz levitating-13a08c508005b9c3b280c05459e943a268b5ccc5.zip |
Fixed static file handler to allow subdirectories properly. Fixed directory file listing under Linux. Release listing now works through CGI.
Diffstat (limited to 'captain/web.f90')
-rw-r--r-- | captain/web.f90 | 13 |
1 files changed, 8 insertions, 5 deletions
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//"<li>"//one_link//"</li>" 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//"<li>"//one_link//"</li>" 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//"<li>"//one_link//"</li>" deallocate(one_link) end do |