1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

- Add p5-Plack-Middleware-MethodOverride 0.10

Writing RESTful apps is a good thing, but if you're also trying to support web
browsers, you're probably going to need some hackish workarounds. This module
provides one such workaround for your Plack applications.

Specifically, you can also use a header named X-HTTP-Method-Override (as used by
Google for its APIs) override the POST request method. Or you can add a
parameter named x-tunneled-method to your form action's query. Either way, the
overriding works only via POST requests, not GET.

If either of these attributes are available in a POST request, the
REQUEST_METHOD key of the Plack environment hash will be replaced with its
value. This allows your apps to override any HTTP method over POST. If your
application needs to know that such overriding has taken place, the original
method is stored under the plack.original_request_method key in the Plack
environment hash.

The list of methods you can specify are: GET, POST, HEAD, PUT, DELETE, OPTIONS,
TRACE and CONNECT.

WWW: http://search.cpan.org/dist/Plack-Middleware-MethodOverride/
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2014-03-29 08:43:21 +00:00
parent c043abf236
commit a5aa14f9f3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=349490
5 changed files with 52 additions and 0 deletions

View File

@ -1139,6 +1139,7 @@
SUBDIR += p5-Plack-Middleware-InteractiveDebugger
SUBDIR += p5-Plack-Middleware-JSConcat
SUBDIR += p5-Plack-Middleware-MemoryUsage
SUBDIR += p5-Plack-Middleware-MethodOverride
SUBDIR += p5-Plack-Middleware-Precompressed
SUBDIR += p5-Plack-Middleware-Reproxy
SUBDIR += p5-Plack-Middleware-ReverseProxy

View File

@ -0,0 +1,25 @@
# Created by: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
# $FreeBSD$
PORTNAME= Plack-Middleware-MethodOverride
PORTVERSION= 0.10
CATEGORIES= www perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Override REST methods to Plack apps via POST
LICENSE= ART10 GPLv1
LICENSE_COMB= dual
BUILD_DEPENDS= p5-Plack>=0.9929:${PORTSDIR}/www/p5-Plack \
p5-URI>=0:${PORTSDIR}/net/p5-URI
RUN_DEPENDS:= ${BUILD_DEPENDS}
TEST_DEPENDS= p5-Test-Pod>=1.41:${PORTSDIR}/devel/p5-Test-Pod \
p5-Test-Pod-Coverage>=1.06:${PORTSDIR}/devel/p5-Test-Pod-Coverage
USE_PERL5= modbuild
USES= perl5
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (Plack-Middleware-MethodOverride-0.10.tar.gz) = f8d6a33b56d69dddd5db289f855e100d86ff39099abe31ef40e2672d0dc5568d
SIZE (Plack-Middleware-MethodOverride-0.10.tar.gz) = 4943

View File

@ -0,0 +1,20 @@
Writing RESTful apps is a good thing, but if you're also trying to support web
browsers, you're probably going to need some hackish workarounds. This module
provides one such workaround for your Plack applications.
Specifically, you can also use a header named X-HTTP-Method-Override (as used by
Google for its APIs) override the POST request method. Or you can add a
parameter named x-tunneled-method to your form action's query. Either way, the
overriding works only via POST requests, not GET.
If either of these attributes are available in a POST request, the
REQUEST_METHOD key of the Plack environment hash will be replaced with its
value. This allows your apps to override any HTTP method over POST. If your
application needs to know that such overriding has taken place, the original
method is stored under the plack.original_request_method key in the Plack
environment hash.
The list of methods you can specify are: GET, POST, HEAD, PUT, DELETE, OPTIONS,
TRACE and CONNECT.
WWW: http://search.cpan.org/dist/Plack-Middleware-MethodOverride/

View File

@ -0,0 +1,4 @@
%%SITE_PERL%%/Plack/Middleware/MethodOverride.pm
%%PERL5_MAN3%%/Plack::Middleware::MethodOverride.3.gz
@dirrmtry %%SITE_PERL%%/Plack/Middleware
@dirrmtry %%SITE_PERL%%/Plack