WebGate

Check-in [e1670c701e]
Login

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

Overview
Comment:make-redirect-response utility procedure
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e1670c701efa169797a176ceb487c3ce269c4cc6
User & Date: murphy 2013-05-31 12:24:46
Context
2013-05-31
12:37
More consistent signature for make-redirect-response check-in: bc50958c55 user: murphy tags: trunk
12:24
make-redirect-response utility procedure check-in: e1670c701e user: murphy tags: trunk
12:21
Support for uri-safe or standard base64-encode check-in: 1b29946a75 user: murphy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to webgate-core.scm.

198
199
200
201
202
203
204





205
206
207
208
209
210
211
	(meta ((name "robots") (content "noindex")))
	(title ,status-line))
       (body
	(h1 ,status-line)
	(p ,message))))
   #:status-message status-message
   #:headers headers))






(define (write-response rsp #!optional (port (current-output-port)))
  (fprintf
   port "Status: ~a ~a\r\n"
   (response-status rsp) (response-status-message rsp))
  (write-message rsp port))








>
>
>
>
>







198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
	(meta ((name "robots") (content "noindex")))
	(title ,status-line))
       (body
	(h1 ,status-line)
	(p ,message))))
   #:status-message status-message
   #:headers headers))

(define (make-redirect-response target #!optional permanent?)
  (make-error-response
   (if permanent? 301 307) `(a ((href ,target)) ,target)
   #:headers `(("Location" . ,target))))

(define (write-response rsp #!optional (port (current-output-port)))
  (fprintf
   port "Status: ~a ~a\r\n"
   (response-status rsp) (response-status-message rsp))
  (write-message rsp port))

Changes to webgate.scm.

61
62
63
64
65
66
67

68
69
70
71
72
73
74
...
110
111
112
113
114
115
116

117
118
119
120
121
122
123
   request-body-handler
   request-parameter-handler
   parameter-list-ref parameter-ref
   resource-context current-resource-context resource-context?
   resource-context-getenv resource-context-method resource-context-path
   response make-response response?
   collect-response make-html-response make-error-response

   response-status response-status-message
   write-response
   resource-handler define-resource resource-uri
   handle-query-parameters
   handle-request)
  (import
   scheme chicken
................................................................................
  (message make-message message?
   message-type message-headers message-body message-text
   parameter-list-ref parameter-ref
   resource-context current-resource-context resource-context?
   resource-context-getenv resource-context-method resource-context-path
   response make-response response?
   collect-response make-html-response make-error-response

   response-status response-status-message
   resource-handler define-resource resource-uri
   send/suspend
   webgate-main)
  (import
   scheme chicken
   srfi-13 webgate-core webgate-suspend webgate-cgi webgate-scgi tcp)







>







 







>







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
   request-body-handler
   request-parameter-handler
   parameter-list-ref parameter-ref
   resource-context current-resource-context resource-context?
   resource-context-getenv resource-context-method resource-context-path
   response make-response response?
   collect-response make-html-response make-error-response
   make-redirect-response
   response-status response-status-message
   write-response
   resource-handler define-resource resource-uri
   handle-query-parameters
   handle-request)
  (import
   scheme chicken
................................................................................
  (message make-message message?
   message-type message-headers message-body message-text
   parameter-list-ref parameter-ref
   resource-context current-resource-context resource-context?
   resource-context-getenv resource-context-method resource-context-path
   response make-response response?
   collect-response make-html-response make-error-response
   make-redirect-response
   response-status response-status-message
   resource-handler define-resource resource-uri
   send/suspend
   webgate-main)
  (import
   scheme chicken
   srfi-13 webgate-core webgate-suspend webgate-cgi webgate-scgi tcp)