From 6c8e6ba0c13b06f28c327da0c507c0a74ba226ed Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 13 May 2021 10:54:27 -0400 Subject: URLs that are just server names will now get an added slash. --- main.F90 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'main.F90') diff --git a/main.F90 b/main.F90 index 0738bb0..7903ca7 100644 --- a/main.F90 +++ b/main.F90 @@ -154,6 +154,8 @@ implicit none if(.not. loaded) then + call check_slashless_url(desired_url) + call r%clear_favicon() call r%report_status("Requesting "//trim(desired_url)) @@ -385,5 +387,28 @@ contains end if end subroutine save_favorites + + ! Checks to see if the url is just a server name with no + ! trailing slash, and fixes it + subroutine check_slashless_url(url) + implicit none + + character(*), intent(inout)::url + integer::i, slash_count + + slash_count = 0 + if(index(url, "://") /= 0) then + do i = 1, len_trim(url) + if(url(i:i) == '/') then + slash_count = slash_count + 1 + end if + end do + + if(slash_count == 2) then + url(i:i) = "/" + end if + end if + + end subroutine check_slashless_url end program gemini -- cgit v1.2.3