Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Proxy headers patch take two

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


autarch at urth

Jun 17, 2007, 11:55 AM

Post #1 of 2 (1059 views)
Permalink
Proxy headers patch take two

Ok, I thought about my first patch and realized that adjusting for the
proxy after the other prepare_* methods were called was kind of gross.
Unfortnuately, the only alternative I could see has its own grossness, in
that each engine must call $self->_proxy_info($c) in various methods in
order to account for a proxy.

The attached patch implements the proxy-related bits fully for the
Catalyst-Runtime distro and Catalyst-Engine-Apache.

It also partially implements this for the Zeus and SCGI engines.

There are some outstanding issues:

* SCGI and Zeus prepare_path() needs to be adjusted in a similar way to
C::E::CGI and C::E::Apache

* The POE server was not altered at all, because I don't understand it ;)

* Is C::E::Server still relevant? It doesn't seem like it, but it may need
updating if so.

* I really hate how the proxy info is cached in the Catalyst object by the
Engine object. This is really unclean, but it's a general problem with
Catalyst, AFAICT.

* I also really hate how the path manipulation stuff is so grotty in
trying to handle doubled slashes.

I could imagine a different implementation that did something like provide
a per-engine RequestInfo class that could be used by Catalyst::Engine to
centralize the logic of the prepare_* methods. This RequestInfo class
would basically be an abstraction on top of CGI/ModPerl/Zeus/POE/whatever.

But I didn't want to go down that road unless there was a very clear
consensus on what that would look like, and whether it should happen at
all.


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
Attachments: proxy.diff (20.4 KB)


autarch at urth

Jun 17, 2007, 12:15 PM

Post #2 of 2 (998 views)
Permalink
Re: Proxy headers patch take two [In reply to]

On Sun, 17 Jun 2007, Dave Rolsky wrote:

> There are some outstanding issues:

One more thing to note ...

It may not be a problem, but it's a subtle change worth bringing to
everyone's attention.

This patch changes the order in which we call $self->prepare_XXX in
Catalyst.pm. We now call prepare_headers before prepare_connection and
prepare_query_parameters.

This was done because each engine has a different way of setting the
headers, but once they're set, we can just look at $c->request->headers in
_proxy_info, which will be called in prepare_connection and prepare_path.

AFAICT, this change shouldn't break anything.


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.rawmode.org/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.