diff options
Diffstat (limited to 'captain/response.f90')
-rw-r--r-- | captain/response.f90 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/captain/response.f90 b/captain/response.f90 index a4fe24e..610b070 100644 --- a/captain/response.f90 +++ b/captain/response.f90 @@ -61,6 +61,7 @@ implicit none character(len=:), pointer::server => null() character(len=:), pointer::protocol => null() character(len=:), pointer::location => null() + character(len=:), pointer::page => null() character(len=:), pointer::query_string => null() contains @@ -101,6 +102,7 @@ contains character(*), intent(in)::str character(*), intent(in), optional::server_explicit, protocol_explicit + character(len=:), allocatable::temppage integer::i, j, n n = len_trim(str) @@ -168,6 +170,16 @@ contains call write_log("Location: "//self%location, LOG_DEBUG) end if + ! and page, which is really just a last location if there is an extension... + ! I realize this is not so great, but whatever. + allocate(character(len=len(self%location)) :: temppage) + call self%last_component(temppage) + if(index(temppage, ".") > 0) then + allocate(character(len=len_trim(temppage)) :: self%page) + self%page = temppage + end if + deallocate(temppage) + end subroutine request_init function request_component_start_location(self, i_component) result(res) @@ -341,6 +353,10 @@ contains deallocate(self%protocol) end if + if(associated(self%page)) then + deallocate(self%page) + end if + end subroutine request_destroy subroutine response_destroy(resp) |