WebGate

Check-in [35c35fb8b5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Default to HTTP header lookup through getenv, even without HTTP_ prefix for soup driver
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:35c35fb8b541cff0cd763dff9a5881dca9e9dba0
User & Date: murphy 2015-05-04 15:17:41
Context
2015-05-04
19:13
Use bundled suspension with protobuf by default, install separately, also allow external version check-in: ef5e410c61 user: murphy tags: trunk
15:17
Default to HTTP header lookup through getenv, even without HTTP_ prefix for soup driver check-in: 35c35fb8b5 user: murphy tags: trunk
14:58
Output remote address and port in the example script check-in: 80136f0ceb user: murphy tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to webgate-soup.scm.

   134    134         (error 'soup-main-loop "Failed to create server" host port))
   135    135       (soup-server-add-handler
   136    136        server #f
   137    137        (lambda (server client message path)
   138    138          (handle-request
   139    139           (lambda (name)
   140    140             (cond
   141         -           ((string-prefix? "HTTP_" name)
   142         -            (soup-request-header-ref message (string-translate (substring/shared name 5) #\_ #\-)))
   143    141              ((string=? name "REQUEST_METHOD")
   144    142               (soup-message-method message))
   145    143              ((string=? name "PATH_INFO")
   146    144               path)
   147    145              ((string=? name "QUERY_STRING")
   148    146               (soup-message-query message))
   149    147   	   ((or (string=? name "REMOTE_ADDR") (string=? name "REMOTE_HOST"))
   150    148   	    (soup-client-address client))
   151    149   	   ((string=? name "REMOTE_PORT")
   152    150   	    (cond ((soup-client-port client) => number->string) (else #f)))
          151  +           ((string-prefix? "HTTP_" name)
          152  +            (soup-request-header-ref message (string-translate (substring/shared name 5) #\_ #\-)))
   153    153   	   (else
   154         -	    #f)))
          154  +	    (soup-request-header-ref message (string-translate name #\_ #\-)))))
   155    155           (open-input-string (soup-request-body message))
   156    156           (cut soup-response-set! message <>))))
   157    157       (soup-server-run server)))