make it easier to derive stuff off HTTP::Daemon
Marc Espie <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <[email protected]> |
I've been trying to use HTTP::Daemon as a proxy to get stuff through
WWW::Mechanize. Turns out I've had to duplicate more code than I hoped for.
- there should be a sub in HTTP::Daemon that says what the client class is.
That way, instead of passing an extra parameter to accept, you can just
derive from HTTP::Daemon.
I'd suggest
sub http_client_class()
{
return "HTTP::Daemon::ClientConn";
}
- useful constants like CRLF should be constant subs, not my variables that
you can reach in subclasses. Granted, there's send_CRLF, but if it's so great,
why don't the internal methods use it ?
- the send_file_response method should invoke more methods, so that it can
be more simply specialized, or that you can do similar things more easily.
- HTTP::Daemon should make use of HTTP::Headers instead of rolling its own.
- Also, the defaults media types don't contain any definition for .css or .js,
which makes it more or less useless for a lot of recent web server activity.
I would be willing to write at least some patches to fix this, depending
whether you term this appropriate.
No offense meant, but currently HTTP::Daemon looks to me half object-oriented,
and it could make a lot of use of the Template Method design pattern to become
more useful...