aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-13 06:48:31 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-13 06:48:31 -0400
commit5024de2a3ba616db4b1b087ab7464f84a74b5688 (patch)
tree2619ef17d7ad1cd4a3024c9aa257b39cc7f1c0d5
parentb470a0c853d060d059e4890f6cbe6ef672edb6ea (diff)
downloadLR-87-5024de2a3ba616db4b1b087ab7464f84a74b5688.tar.gz
LR-87-5024de2a3ba616db4b1b087ab7464f84a74b5688.zip
Relative URL redirects should now work properly.
-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