summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-02-21 18:23:16 +0100
committerfranck cuny <franck@lumberjaph.net>2011-07-26 13:19:59 +0200
commit8d1b6ee8818ddc9528a871de511db0aa8234af75 (patch)
tree76029901d9389b1c26b8215294599876e366cb27
parentno debug here (diff)
downloadnet-http-spore-8d1b6ee8818ddc9528a871de511db0aa8234af75.tar.gz
add host method to request object
-rw-r--r--lib/Net/HTTP/Spore/Request.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore/Request.pm b/lib/Net/HTTP/Spore/Request.pm
index 365e736..a401dcc 100644
--- a/lib/Net/HTTP/Spore/Request.pm
+++ b/lib/Net/HTTP/Spore/Request.pm
@@ -68,6 +68,15 @@ sub method {
     }
 }
 
+sub host {
+    my ($self, $value) = @_;
+    if ($value) {
+        $self->set_to_env('SERVER_NAME', $value);
+    }else{
+        return $self->get_from_env('SERVER_NAME');
+    }
+}
+
 sub port {
     my ( $self, $value ) = @_;
     if ($value) {