From 5024de2a3ba616db4b1b087ab7464f84a74b5688 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 13 May 2020 06:48:31 -0400 Subject: Relative URL redirects should now work properly. --- protocol.f90 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/protocol.f90 b/protocol.f90 index 8f0cd70..e8039d3 100644 --- a/protocol.f90 +++ b/protocol.f90 @@ -155,6 +155,7 @@ contains integer, intent(in)::unit_number character(*), intent(inout)::url + character(1024)::new_url character::search integer::i, istat @@ -164,8 +165,7 @@ contains read(unit_number, '(A1)', advance='no') search read(unit_number, '(A1)', advance='no') search - ! Clear the url - url = repeat(" ", len(url)) + new_url = " " ! At least one whitespace, but whatever... read(unit_number, '(A1)', advance='no') search @@ -177,9 +177,16 @@ contains i = 0 do while(search /= CHAR(13) .and. i < len(url) .and. istat == 0) i = i + 1 - url(i:i) = search + new_url(i:i) = search read(unit_number, '(A1)', advance='no', iostat=istat) search end do + + ! Process this url properly + if(index(new_url, "://") > 0) then + url = new_url + else + call handle_relative_url(url, new_url) + end if end subroutine get_redirect_url -- cgit v1.2.3