Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Reyk Floeter
On Tue, Jun 23, 2015 at 02:40:48PM -0400, Jean-Philippe Ouellet wrote: > On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: > > there is some great interest in getting support for rewrites > > What do people think of something like our tftpd(8)'s -r > >-r socket > Issue fi

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Jean-Philippe Ouellet
On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: > there is some great interest in getting support for rewrites What do people think of something like our tftpd(8)'s -r -r socket Issue filename rewrite requests to the specified UNIX domain socket. tftpd will wri

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread trondd
On Tue, June 23, 2015 11:28 am, Reyk Floeter wrote: > It is just not done yet. As I said, we're improving the interface. > But this doesn't affect the initial implementation itself. > > Reyk > Ok, thanks. I think I have a 'location match' use case I can play with, too. Tim.

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Sebastien Marie
On Tue, Jun 23, 2015 at 04:20:58PM +0200, Reyk Floeter wrote: > On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: > > Comments? OK? > > > > This diff includes some fixes from semarie@. We also have regress > tests that will go in separately. We'd like to continue in the tree. > > O

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Reyk Floeter
On Tue, Jun 23, 2015 at 10:25:36AM -0400, trondd wrote: > On Sun, June 21, 2015 10:01 am, Reyk Floeter wrote: > >> > >> location match '^/page/(%d+)' { > >> block return 302 "/index.cgi?page=%1' > >> } > >> > > So I was playing with the below config, then figured ou

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread trondd
On Sun, June 21, 2015 10:01 am, Reyk Floeter wrote: >> >> location match '^/page/(%d+)' { >> block return 302 "/index.cgi?page=%1' >> } >> So I was playing with the below config, then figured out it's not coded to capture on 'server match'. I want to redirect anyth

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Reyk Floeter
On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: > Comments? OK? > This diff includes some fixes from semarie@. We also have regress tests that will go in separately. We'd like to continue in the tree. OK? Reyk Index: Makefile

Re: httpd rewrites with Lua's pattern matching

2015-06-22 Thread Gregory Edigarov
what a nice small piece of code! I think it should be made into library, as there are other projects(think smtpd), that would benefit from it too. On 06/21/2015 05:01 PM, Reyk Floeter wrote: On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: Hi, there is some great interest in get

Re: httpd rewrites with Lua's pattern matching

2015-06-21 Thread Reyk Floeter
On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: > Hi, > > there is some great interest in getting support for rewrites and > better matching in httpd. I refused to implement this using regex, as > regex is extremely complicated code, there have been lots of bugs, > they allow, if no

httpd rewrites with Lua's pattern matching

2015-06-20 Thread Reyk Floeter
Hi, there is some great interest in getting support for rewrites and better matching in httpd. I refused to implement this using regex, as regex is extremely complicated code, there have been lots of bugs, they allow, if not specified carefully, dangerous recursions and ReDOS, and I would add ano