16
16
17
17
class AsynchronousRequestProcessor implements RequestProcessorInterface
18
18
{
19
- const PROCESSOR_PATH = ' async/V1 ' ;
19
+ const PROCESSOR_PATH = " / async/V \\ d+/ " ;
20
20
21
21
/**
22
22
* @var \Magento\Framework\Webapi\Rest\Response
@@ -58,7 +58,8 @@ public function __construct(
58
58
MassSchedule $ asyncBulkPublisher ,
59
59
WebApiAsyncConfig $ webapiAsyncConfig ,
60
60
DataObjectProcessor $ dataObjectProcessor
61
- ) {
61
+ )
62
+ {
62
63
$ this ->response = $ response ;
63
64
$ this ->inputParamsResolver = $ inputParamsResolver ;
64
65
$ this ->asyncBulkPublisher = $ asyncBulkPublisher ;
@@ -95,20 +96,12 @@ public function process(\Magento\Framework\Webapi\Rest\Request $request)
95
96
);
96
97
97
98
$ this ->response ->setStatusCode (RestResponse::STATUS_CODE_202 )
98
- ->prepareResponse ($ responseData );
99
+ ->prepareResponse ($ responseData );
99
100
} catch (\Exception $ e ) {
100
101
$ this ->response ->setException ($ e );
101
102
}
102
103
}
103
104
104
- /**
105
- * {@inheritdoc}
106
- */
107
- public function getProcessorPath ()
108
- {
109
- return self ::PROCESSOR_PATH ;
110
- }
111
-
112
105
/**
113
106
* @param \Magento\Framework\Webapi\Rest\Request $request
114
107
* @return string
@@ -126,8 +119,9 @@ private function getTopicName($request)
126
119
/**
127
120
* {@inheritdoc}
128
121
*/
129
- public function canProcess (\Magento \Framework \Webapi \Rest \Request $ request ) {
130
- if (strpos (ltrim ($ request ->getPathInfo (), '/ ' ), $ this ->getProcessorPath ()) === 0 ) {
122
+ public function canProcess (\Magento \Framework \Webapi \Rest \Request $ request )
123
+ {
124
+ if (preg_match (self ::PROCESSOR_PATH , ltrim ($ request ->getPathInfo (), '/ ' )) === 0 ) {
131
125
return true ;
132
126
}
133
127
return false ;
0 commit comments