aboutsummaryrefslogtreecommitdiffstats
path: root/www/p5-Plack-Middleware-MethodOverride
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2014-03-29 16:43:21 +0800
committersunpoet <sunpoet@FreeBSD.org>2014-03-29 16:43:21 +0800
commit6dcc01b7b71ad35b7fb1bfa6ab81d5683ff3439b (patch)
tree6c62da6b926ccc81bcf6fa3e0291c766d58dfa0e /www/p5-Plack-Middleware-MethodOverride
parent48aebcda50d201352cd7bf29878aa2b9fc48d523 (diff)
downloadfreebsd-ports-gnome-6dcc01b7b71ad35b7fb1bfa6ab81d5683ff3439b.tar.gz
freebsd-ports-gnome-6dcc01b7b71ad35b7fb1bfa6ab81d5683ff3439b.tar.zst
freebsd-ports-gnome-6dcc01b7b71ad35b7fb1bfa6ab81d5683ff3439b.zip
- 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/
Diffstat (limited to 'www/p5-Plack-Middleware-MethodOverride')
-rw-r--r--www/p5-Plack-Middleware-MethodOverride/Makefile25
-rw-r--r--www/p5-Plack-Middleware-MethodOverride/distinfo2
-rw-r--r--www/p5-Plack-Middleware-MethodOverride/pkg-descr20
-rw-r--r--www/p5-Plack-Middleware-MethodOverride/pkg-plist4
4 files changed, 51 insertions, 0 deletions
diff --git a/www/p5-Plack-Middleware-MethodOverride/Makefile b/www/p5-Plack-Middleware-MethodOverride/Makefile
new file mode 100644
index 000000000000..94d3e5fa0d8a
--- /dev/null
+++ b/www/p5-Plack-Middleware-MethodOverride/Makefile
@@ -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>
diff --git a/www/p5-Plack-Middleware-MethodOverride/distinfo b/www/p5-Plack-Middleware-MethodOverride/distinfo
new file mode 100644
index 000000000000..2876421729f5
--- /dev/null
+++ b/www/p5-Plack-Middleware-MethodOverride/distinfo
@@ -0,0 +1,2 @@
+SHA256 (Plack-Middleware-MethodOverride-0.10.tar.gz) = f8d6a33b56d69dddd5db289f855e100d86ff39099abe31ef40e2672d0dc5568d
+SIZE (Plack-Middleware-MethodOverride-0.10.tar.gz) = 4943
diff --git a/www/p5-Plack-Middleware-MethodOverride/pkg-descr b/www/p5-Plack-Middleware-MethodOverride/pkg-descr
new file mode 100644
index 000000000000..799d48af2f0a
--- /dev/null
+++ b/www/p5-Plack-Middleware-MethodOverride/pkg-descr
@@ -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/
diff --git a/www/p5-Plack-Middleware-MethodOverride/pkg-plist b/www/p5-Plack-Middleware-MethodOverride/pkg-plist
new file mode 100644
index 000000000000..85601aaf6a82
--- /dev/null
+++ b/www/p5-Plack-Middleware-MethodOverride/pkg-plist
@@ -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