mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Fix validation of Harbormaster HTTP methods
Summary: Precedence here was mucked up. Test Plan: Plan with no explicit "method" now defaults to POST correctly. Reviewers: dctrwatson, btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8559
This commit is contained in:
parent
809e5a0389
commit
a2a4f4b3da
1 changed files with 12 additions and 4 deletions
|
@ -59,11 +59,19 @@ final class HarbormasterHTTPRequestBuildStepImplementation
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($settings['method'] === null || $settings['method'] != '' &&
|
||||
!in_array ($settings['method'],
|
||||
array('GET', 'PUT', 'DELETE', 'POST'))) {
|
||||
$methods = array(
|
||||
'GET' => true,
|
||||
'POST' => true,
|
||||
'DELETE' => true,
|
||||
'PUT' => true,
|
||||
);
|
||||
|
||||
$method = idx($settings, 'method');
|
||||
if (strlen($method)) {
|
||||
if (empty($methods[$method])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue