Patch for 4.0.0 web browser - fixing proxying & relative urls.

From: Harvey J. Stein <hjstein_at_bfr.co.il>
Date: Mon, 13 Sep 1999 15:05:21 -0400

Here's a small patch for STK 4.0.0 to fix proxy support & relative url
handling. Specifically, when parsing relative URLs, if the parent's
url was proxitized it had to be unproxitized before proceeding.
Otherwise garbage ensued. There was also a bug in the usage of
pretty-url. It can't be called in general on url & parent. It has to
be applied, in case parent is '().

diff -u /usr/local/lib/stk/4.0.0/STk/www-url.stk www/www-url.stk
--- /usr/local/lib/stk/4.0.0/STk/www-url.stk Sun Sep 5 07:48:58 1999
+++ www/www-url.stk Mon Sep 13 14:54:09 1999
_at_@ -128,7 +128,13 @@
 ;;; protocol, the host name, and the file name.
 
 (define (parse-url url . parent)
- (proxitize (apply relativize (basic-parse-url url) parent)))
+ (let ((p (proxitize (apply relativize (basic-parse-url url)
+ (cond ((null? parent) '())
+ ((through-proxy? (car parent))
+ (list (basic-parse-url (apply unparse-url parent))))
+ (t parent))))))
+;; (format #t "parse-url: called with url = ~s parent = ~s. Result = ~s\n" url parent p)
+ p))
 
 (define (basic-parse-url url)
   (let* ((base (split url-regexp url))
diff -u /usr/local/lib/stk/4.0.0/STk/www.stk www/www.stk
--- /usr/local/lib/stk/4.0.0/STk/www.stk Sun Sep 5 07:48:58 1999
+++ www/www.stk Mon Sep 13 14:34:52 1999
_at_@ -155,7 +155,7 @@
   (www:hook-start-loading)
   
   (let ((res (apply www:insert-url txt url parent)))
- (www:hook-location (url:pretty-url url parent))
+ (www:hook-location (apply url:pretty-url url parent))
     (tk-set! txt :state "disabled") ; make text read-only
     (www:hook-stop-loading)
     (set! *loading-document* #f)
_at_@ -199,7 +199,7 @@
                                                  'txt)
                                              #f))))
       (unless viewer ; again
- (error "Don't know how to view the URL ~S" (url:pretty-url url parent))))
+ (error "Don't know how to view the URL ~S" (apply url:pretty-url url parent))))
     
     ;; Viewer is known now. Here we go
     (let ((res (viewer txt port parsed-url)))
Received on Mon Sep 13 1999 - 21:08:30 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST