diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2020-05-05 11:56:54 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2020-05-05 11:56:54 -0400 |
commit | b063cac571202757ec25f2c6e2a772684b88d4ae (patch) | |
tree | bcdd9426a90d8e9bec4498bffd2f97686ba28d41 /main.F90 | |
parent | 0ade9914918238b8da35e995fe9782a517988ae2 (diff) | |
download | LR-87-b063cac571202757ec25f2c6e2a772684b88d4ae.tar.gz LR-87-b063cac571202757ec25f2c6e2a772684b88d4ae.zip |
Added input handling with escaping, all untested.
Diffstat (limited to 'main.F90')
-rw-r--r-- | main.F90 | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -18,6 +18,7 @@ implicit none logical::running logical::loaded + logical::populated integer::return_code @@ -62,11 +63,19 @@ implicit none do while(running) + if(index(current_url, "gemini://") /= 1) then + call r%draw_error("Only gemini:// URLs are supported") + populated = .false. + loaded = .true. + return_code = STATUS_LOCALFAIL + end if + if(.not. loaded) then call r%report_status("Requesting "//trim(current_url)) return_code = request_url(trim(current_url), io) + populated = .true. call update_status(r, current_url, return_code) @@ -76,8 +85,18 @@ implicit none call get_redirect_url(io, current_url) loaded = .false. + populated = .false. - else + else if(return_code == STATUS_INPUT) then + + if(handle_input(r, current_url, io)) then + ! Should force a new load + loaded = .false. + else + loaded = .true. + end if + + else if(populated) then first_line => load_unit(io, file_type_gemini) loaded = .true. |