- Added some backcompat code when setting a response body to an object
that does 'read' but not 'getline'. Added deprecation notice for this
case. Added docs to Catalyst::Delta.
- - Official warning that Catalyst::Engine::PSGI is no longer supported and
- we will be removing any existing backcompat code for this engine in a
- future release. Other deprecations noted, see Catalyst::Delta.
- - $c->res->has_body is now considered true if you've even once requested a
- $c->res->write_fh or called $c->res->write.
+ - Catalyst::Delta contains a list of behaviors which will be considered
+ deprecated immediatelty. Most items have workarounds and tweaks you can
+ make to avoid issues. These deprecations are targeted for removal/enforcement
+ in the Catalyst 6 release. Please review and give your feedback.
+ - More middleware to replace inline code (upasana++)
5.90059_003 - 2013-12-24
- More documentation about alternative ways to setup middleware.
requires "Plack::Middleware::Head";
requires "Plack::Middleware::HTTPExceptions";
requires "Plack::Middleware::FixMissingBodyInRedirect";
+requires "Plack::Middleware::MethodOverride;
test_requires 'Test::Fatal';
test_requires 'Test::More' => '0.88';
use Plack::Middleware::Head;
use Plack::Middleware::HTTPExceptions;
use Plack::Middleware::FixMissingBodyInRedirect;
+use Plack::Middleware::MethodOverride;
use Plack::Util;
use Class::Load 'load_class';
Plack::Middleware::HTTPExceptions->new,
Plack::Middleware::FixMissingBodyInRedirect->new,
Plack::Middleware::ContentLength->new,
+ Plack::Middleware::MethodOverride->new,
Plack::Middleware::Head->new,
@$middleware);
} else {
around ['match','match_captures'] => sub {
my ($orig, $self, $ctx, @args) = @_;
- my $expected = $self->_normalize_expected_http_method($ctx->req);
+ my $expected = $ctx->req->method;
return $self->_has_expected_http_method($expected) ?
$self->$orig($ctx, @args) :
0;
};
-sub _normalize_expected_http_method {
- my ($self, $req) = @_;
- return $req->header('X-HTTP-Method') ||
- $req->header('X-HTTP-Method-Override') ||
- $req->header('X-METHOD-OVERRIDE') ||
- $req->header('x-tunneled-method') ||
- $req->method;
-}
sub _has_expected_http_method {
my ($self, $expected) = @_;
HTTP methods, such as GET, POST, etc.
Since most web browsers have limited support for rich HTTP Method vocabularies
-we also support setting the expected match method via the follow non standard
-but widely used http extensions. Our support for these should not be taken as
-an endorsement of the technique. Rt is merely a reflection of our desire to
-work well with existing systems and common client side tools.
-
-=over 4
-
-=item X-HTTP-Method (Microsoft)
-
-=item X-HTTP-Method-Override (Google/GData)
-
-=item X-METHOD-OVERRIDE (IBM)
-
-=item x-tunneled-method (used in many other similar systems on CPAN
-
-=back
-
-Please note the insanity of overriding a GET request with a DELETE override...
-Rational practices suggest that using POST with overrides to emulate PUT and
-DELETE can be an acceptable way to deal with client limitations and security
-rules on your proxy server. I recommend going no further.
+we use L<Plack::Middleware::MethodOverride> which allows you to 'tunnel' your
+request method over POST This works in two ways. You can set an extension
+HTTP header C<X-HTTP-Method-Override> which will contain the value of the
+desired request method, or you may set a search query parameter
+C<x-tunneled-method>. Remember, these only work over HTTP Request type
+POST. See L<Plack::Middleware::MethodOverride> for more.
=head1 REQUIRES
Setting $c->res->body to a filehandle after using $c->res->write or
$c->res->write_fh is no longer considered allowed, since we can't send
the filehandle to the underlying Plack handler. For now we will continue
-to support setting body to a simple value since
+to support setting body to a simple value since this is possible, but at
+some future release a choice to use streaming indicates that you will do
+so for the rest of the request.
=head2 VERSION 5.90053