File tree 2 files changed +7
-10
lines changed
lib/MetaCPAN/Server/Controller 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -28,21 +28,18 @@ sub _mapping : Path('_mapping') : Args(0) {
28
28
$c -> detach(' /not_found' );
29
29
}
30
30
31
- sub find : Path(' _search' ) : Args(0) {
31
+ sub find : Path(' _search' ) : Args(0) : ActionClass( ' ~Deserialize ' ) {
32
32
my ( $self , $c , $scroll ) = @_ ;
33
33
34
34
my @hits ;
35
35
36
36
# fake results for MetaCPAN::Client so it doesn't fail its tests
37
- if ( ( $c -> req-> user_agent // ' ' )
38
- =~ m { ^MetaCPAN::Client-testing/([0-9.]+)} )
39
- {
37
+ if ( ( $c -> req-> user_agent // ' ' ) =~ m { ^MetaCPAN::Client/([0-9.]+)} ) {
40
38
if ( $1 <= 2.031001 ) {
41
- my $query = $c -> read_param( ' query' ) ;
39
+ my $query = $c -> req -> data -> { ' query' } ;
42
40
if ( $query
43
- && $query -> [0]
44
- && $query -> [0]{term }
45
- && ( $query -> [0]{term }{distribution } // ' ' ) eq ' Moose' )
41
+ && $query -> {term }
42
+ && ( $query -> {term }{distribution } // ' ' ) eq ' Moose' )
46
43
{
47
44
48
45
push @hits ,
@@ -72,7 +69,7 @@ sub find : Path('_search') : Args(0) {
72
69
} );
73
70
}
74
71
75
- sub all : Path(' ' ) : Args(0) {
72
+ sub all : Path(' ' ) : Args(0) : ActionClass( ' ~Deserialize ' ) {
76
73
my ( $self , $c ) = @_ ;
77
74
$c -> forward(' find' );
78
75
}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ test_psgi app, sub {
92
92
ok(
93
93
$res = $cb -> (
94
94
POST ' /rating/_search' ,
95
- ' User-Agent' => ' MetaCPAN::Client-testing /2.031001' ,
95
+ ' User-Agent' => ' MetaCPAN::Client/2.031001' ,
96
96
Content => ' {"query":{"term":{"distribution":"Moose"}}}' ,
97
97
),
98
98
' POST /rating with MetaCPAN::Client test UA'
You can’t perform that action at this time.
0 commit comments