Hi Nathaniel,

On Tue, 24 Mar 2015 17:29:08 +0100 Nathaniel Rudavsky-Brody 
<[email protected]> wrote:

> I'm having a problem with headers when using nginx's proxy_pass with
> awful, and I'm not sure if it's a question of nginx or Chicken, or
> just my misunderstanding of headers...
>
> Everything works fine except when I use (send-static-file) as in:
>
> (define-page (regexp "/file/.+")
> (lambda (url)
> (parameterize ((root-path (data-dir)))
> (send-static-file (string-drop url 6)))))

I suppose you'd need to wrap send-static-file into a lambda, since
send-static-file itself will set HTTP headers.  You probably also want
`no-template: #t', otherwise `define-page' will generate some HTML.

Something like this:

(define-page (regexp "/file/.+")
  (lambda (url)
    (lambda ()
      (parameterize ((root-path (data-dir)))
        (send-static-file (string-drop url 6)))))
  no-template: #t)

That inner lambda will make awful transfer all the responsability of
setting headers to the handler, which send-static-file will do.

I'm not really sure this is the real cause of the problem and I don't
know why clients' behavior are different.

I hope it helps.

Best wishes.
Mario
-- 
http://parenteses.org/mario

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to