tech-userlevel archive

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

Re: Dynamic content with bozohttpd



Am 12.10.13 09:18, schrieb Alan Barrett:
> On Fri, 11 Oct 2013, Marc Balmer wrote:
>> Presenting Lua support for httpd.
> 
> This looks good.  I have the following comments:
> 
> 1. Please keep white space changes separate from functional changes.

Yes.  It's always the same issue with BBEdit, it strips trailing
whitespace when a file is saved and then this change goes unnoticed.  I
will take care it gets commited separately.

> 
> 2. It needs documentation.  In particular, an explanation is needed for
> the way requests like http://hostname/rest/printenv are handled by
> recognising "rest" from the "-L" command line option and recognising
> "printenv" from the httpd.register_handler call performed inside the
> printenv.lua script.

Yes.  In the meantime I documented it in the man page (which was not in
my diff).

> 3. For requests like
> "http[s]://<hostname>/<prefix>/<handler>/<subpath>?<query>", if the
> handler wants to get at the <subpath> part of the request, then it has
> to do its own string manipulation, stripping off the prefix and handler
> name from the REQUEST_URL.  I think that this would be better done once
> in the bozo_process_lua() function, not duplicated in every handler. 

True.  The query parameters and such should be decoded and handed to Lua
in a table.  I will work in this (I need it myself...)

> Passing the <handler> string in the
> Lua environment would probably also be useful.

That could be done easily, I jist need to store it.

> 4. I'd usually prefer to have positive options like WITH_LUA_SUPPORT
> instead of negative options like NO_LUA_SUPPORT. On the other hand,
> existing practice in this program is to use negative options, so
> following that precedent is probably best.

Yes, I followed the "spirit" of the existing code here.

Thanks for your feedback.

- Marc

> 
> --apb (Alan Barrett)



Home | Main Index | Thread Index | Old Index