Mercurial > pub > Impl
comparison Lib/IMPL/Web/Handler/RestController.pm @ 230:6d8092d8ce1b
*reworked IMPL::Security
*reworked IMPL::Web::Security
*refactoring
| author | sergey |
|---|---|
| date | Mon, 08 Oct 2012 03:37:37 +0400 |
| parents | 47f77e6409f7 |
| children | 3cebcf6fdb9b |
comparison
equal
deleted
inserted
replaced
| 229:47f77e6409f7 | 230:6d8092d8ce1b |
|---|---|
| 36 | 36 |
| 37 if (length $pathInfo) { | 37 if (length $pathInfo) { |
| 38 | 38 |
| 39 @segments = split(/\//, $pathInfo, $this->trailingSlash ? -1 : 0); | 39 @segments = split(/\//, $pathInfo, $this->trailingSlash ? -1 : 0); |
| 40 | 40 |
| 41 # remove first segment since it's always empty | 41 # remove first segment if it is empty |
| 42 shift @segments; | 42 shift @segments if @segments && length($segments[0]) == 0; |
| 43 | 43 |
| 44 my ($obj,$view) = (pop(@segments) =~ m/(.*?)(?:\.(\w+))?$/); | 44 if(@segments) { |
| 45 push @segments, $obj; | 45 my ($obj,$view) = (pop(@segments) =~ m/(.*?)(?:\.(\w+))?$/); |
| 46 push @segments, $obj; | |
| 47 } | |
| 46 | 48 |
| 47 } | 49 } |
| 48 | 50 |
| 49 return @segments; | 51 return @segments; |
| 50 } | 52 } |
| 61 | 63 |
| 62 while(@segments) { | 64 while(@segments) { |
| 63 my $id = shift @segments; | 65 my $id = shift @segments; |
| 64 | 66 |
| 65 $res = $res->FetchChildResource($id); | 67 $res = $res->FetchChildResource($id); |
| 66 | |
| 67 die NotFoundException->new($pathInfo,$id) unless $res; | |
| 68 } | 68 } |
| 69 | 69 |
| 70 $res = $res->InvokeHttpVerb($method,$action); | 70 $res = $res->InvokeHttpVerb($method,$action); |
| 71 } | 71 } |
| 72 | 72 |
