chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] headers with nginx + awful


From: Mario Domenech Goulart
Subject: Re: [Chicken-users] headers with nginx + awful
Date: Wed, 25 Mar 2015 09:45:35 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Hi Nathaniel,

On Tue, 24 Mar 2015 17:29:08 +0100 Nathaniel Rudavsky-Brody <address@hidden> 
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]