diff options
Diffstat (limited to 'captain/external.f90')
-rw-r--r-- | captain/external.f90 | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/captain/external.f90 b/captain/external.f90 index 146060f..5e64bab 100644 --- a/captain/external.f90 +++ b/captain/external.f90 @@ -108,6 +108,7 @@ contains function is_request_static(req) use server_response + use logging implicit none class(request), intent(in)::req @@ -116,7 +117,13 @@ contains call req%path_component(1, first) - is_request_static = ((first == "releases") .or. (first == "uploads")) + call write_log("Static check: "//trim(first)) + + is_request_static = ((trim(first) == "releases") .or. & + (trim(first) == "uploads") .or. & + (trim(first) == "results") .or. & + (trim(first) == "static") .or. & + (trim(first) == "favicon.txt")) end function is_request_static @@ -138,17 +145,29 @@ contains call req%path_component(1, category) call req%last_component(filename) + call write_log("Catgeory: "//trim(category)//" File: "//trim(filename)) + if(category == "releases") then allocate(character(len=(len_trim(release_dir)+len_trim(filename)+1)) :: resp%body_filename) call combine_paths(release_dir, filename, resp%body_filename) else if(category == "uploads") then allocate(character(len=(len_trim(release_dir)+len_trim(filename)+1)) :: resp%body_filename) call combine_paths(release_dir, filename, resp%body_filename) + else if(category == "results") then + allocate(character(len=(len_trim(results_dir)+len_trim(filename)+1)) :: resp%body_filename) + call combine_paths(results_dir, filename, resp%body_filename) + else if(category == "static") then + allocate(character(len=(len_trim(static_dir)+len_trim(filename)+1)) :: resp%body_filename) + call combine_paths(static_dir, filename, resp%body_filename) + else if(category == "favicon.txt") then + allocate(character(len=(len_trim(static_dir)+len_trim(filename)+1)) :: resp%body_filename) + call combine_paths(static_dir, filename, resp%body_filename) end if inquire(file=resp%body_filename, exist=exists) if(.not. exists) then resp%code = GEMINI_CODE_PERMFAIL + call write_log("File did not exist: "//resp%body_filename) else resp%code = GEMINI_CODE_SUCCESS |