[ prog / sol / mona ]

prog


SchemeBBS [part 2]

16 2020-07-01 10:48

In post-message:

(frontpage (lookup-def 'frontpage params))
(message (decode-formdata (lookup-def 'epistula params)))

From lookup-def:

    ((lookup-def key alist)
     (let ((nkey key) (nalist alist)) ; evaluate them only once
       (let ((res (assq nkey nalist)))
         (if res
             (let ((res (cdr res)))
               (cond
                 ((not (pair? res)) res)
                 ((null? (cdr res)) (car res))
                 (else res)))
             (error "Failed to find " nkey " in " nalist)))))

As a result, posting without frontpage or epistula gives:

  HTTP/1.1 502 Bad Gateway
  Server: nginx/1.18.0
  Date: Wed, 01 Jul 2020 10:35:57 GMT
  Content-Type: text/html
  Content-Length: 496
  Connection: keep-alive
  ETag: "5ecc391b-1f0"

Both lookups need a default followed by validation if 502 Bad Gateway is to be avoided.

112


VIP:

do not edit these