diff Lib/IMPL/Web/Application/Action.pm @ 256:32aceba4ee6d

corrected ViewHandlers to handle cookies and headers. Dirty hacks to handle binary data RestController doesn't deal with file extensions anymore.
author sergey
date Wed, 12 Dec 2012 04:29:50 +0400
parents 7c517134c42f
children 89179bb8c388
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Action.pm	Fri Dec 07 16:58:19 2012 +0400
+++ b/Lib/IMPL/Web/Application/Action.pm	Wed Dec 12 04:29:50 2012 +0400
@@ -4,6 +4,7 @@
 use Carp qw(carp);
 
 use IMPL::Const qw(:prop);
+use IMPL::Web::CGIWrapper();
 
 use IMPL::declare {
     base => [
@@ -49,11 +50,26 @@
     $this->_launder($value, $rx );
 }
 
+sub rawData {
+    my ($this) = @_;
+    
+    local $IMPL::Web::CGIWrapper::NO_DECODE = 1;
+    if ($this->requestMethod eq 'POST') {
+        return $this->query->param('POSTDATA');
+    } elsif($this->requestMethod eq 'PUT') {
+        return $this->query->param('PUTDATA');
+    }
+}
+
 sub requestMethod {
     my ($this) = @_;
     return $this->query->request_method;
 }
 
+sub contentType {
+    return shift->query->content_type();
+}
+
 sub pathInfo {
     my ($this) = @_;
     return $this->query->path_info;