aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocol.f9013
1 files 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