Allow multiple request methods per callback.
This commit is contained in:
parent
5dedecb2f3
commit
abd31ca0ef
|
|
@ -1,9 +1,13 @@
|
|||
<?php
|
||||
|
||||
function civiproxy_callback_validate_request_method($expected, $actual){
|
||||
if($expected != $actual){
|
||||
civiproxy_http_error("Invalid request method.", 405);
|
||||
if(is_array($expected) && in_array($actual, $expected)){
|
||||
return;
|
||||
}
|
||||
if(is_string($expected) && $expected == $actual){
|
||||
return;
|
||||
}
|
||||
civiproxy_http_error("Invalid request method.", 405);
|
||||
}
|
||||
|
||||
function civiproxy_callback_validate_content_type($expected, $actual){
|
||||
|
|
|
|||
|
|
@ -122,8 +122,8 @@ $callbacks_enabled = false;
|
|||
|
||||
$callbacks = [
|
||||
'sparkpost' => [
|
||||
// 'secret' => '',
|
||||
'request_method' => 'POST',
|
||||
'secret' => '85c573b980c3c248f083f9ca6a175659',
|
||||
'request_method' => 'POST', // single value or array
|
||||
'content_type' => 'application/json',
|
||||
'target_path' => 'civicrm/sparkpost/callback'
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue