comparison Lib/IMPL/Web/Handler/RestController.pm @ 208:3d433a977e3b

corrected RestController for empty PAT_INFO corrected charset for ErrorHandler
author sergey
date Fri, 18 May 2012 18:43:00 +0400
parents c8fe3f84feba
children 292226770180
comparison
equal deleted inserted replaced
207:f534a60d5b01 208:3d433a977e3b
37 37
38 my $method = $query->request_method; 38 my $method = $query->request_method;
39 39
40 #TODO: path_info is broken for IIS 40 #TODO: path_info is broken for IIS
41 my $pathInfo = $query->path_info; 41 my $pathInfo = $query->path_info;
42 my @segments;
42 43
43 my @segments = split /\//, $pathInfo, -1; # keep trailing empty string if present 44 if (length $pathInfo) {
44 45
45 # remove first segment since it's always empty 46 @segments = split /\//, $pathInfo, -1; # keep trailing empty string if present
46 shift @segments; 47
48 # remove first segment since it's always empty
49 shift @segments;
50
51 my ($obj,$view) = (pop(@segments) =~ m/(.*?)(?:\.(\w+))?$/);
52 push @segments, $obj;
47 53
48 my ($obj,$view) = (pop(@segments) =~ m/(.*?)(?:\.(\w+))?$/); 54 }
49 push @segments, $obj; 55
50 56
51 my $res = $this->contract->Transform($this->root, { id => '' } ); 57 my $res = $this->contract->Transform($this->root, { id => '' } );
52 58
53 while(@segments) { 59 while(@segments) {
54 my $id = shift @segments; 60 my $id = shift @segments;