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 Unified Diffs Ignore Whitespace Patch

Changes to webgate-soup.scm.

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152


153
154

155
156
157
      (error 'soup-main-loop "Failed to create server" host port))
    (soup-server-add-handler
     server #f
     (lambda (server client message path)
       (handle-request
        (lambda (name)
          (cond
           ((string-prefix? "HTTP_" name)
            (soup-request-header-ref message (string-translate (substring/shared name 5) #\_ #\-)))
           ((string=? name "REQUEST_METHOD")
            (soup-message-method message))
           ((string=? name "PATH_INFO")
            path)
           ((string=? name "QUERY_STRING")
            (soup-message-query message))
	   ((or (string=? name "REMOTE_ADDR") (string=? name "REMOTE_HOST"))
	    (soup-client-address client))
	   ((string=? name "REMOTE_PORT")
	    (cond ((soup-client-port client) => number->string) (else #f)))


	   (else
	    #f)))

        (open-input-string (soup-request-body message))
        (cut soup-response-set! message <>))))
    (soup-server-run server)))







<
<










>
>

<
>



134
135
136
137
138
139
140


141
142
143
144
145
146
147
148
149
150
151
152
153

154
155
156
157
      (error 'soup-main-loop "Failed to create server" host port))
    (soup-server-add-handler
     server #f
     (lambda (server client message path)
       (handle-request
        (lambda (name)
          (cond


           ((string=? name "REQUEST_METHOD")
            (soup-message-method message))
           ((string=? name "PATH_INFO")
            path)
           ((string=? name "QUERY_STRING")
            (soup-message-query message))
	   ((or (string=? name "REMOTE_ADDR") (string=? name "REMOTE_HOST"))
	    (soup-client-address client))
	   ((string=? name "REMOTE_PORT")
	    (cond ((soup-client-port client) => number->string) (else #f)))
           ((string-prefix? "HTTP_" name)
            (soup-request-header-ref message (string-translate (substring/shared name 5) #\_ #\-)))
	   (else

	    (soup-request-header-ref message (string-translate name #\_ #\-)))))
        (open-input-string (soup-request-body message))
        (cut soup-response-set! message <>))))
    (soup-server-run server)))