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