1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 13:22:42 +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:
epriestley 2014-03-18 12:05:14 -07:00
parent 809e5a0389
commit a2a4f4b3da

View file

@ -59,11 +59,19 @@ final class HarbormasterHTTPRequestBuildStepImplementation
return false; return false;
} }
if ($settings['method'] === null || $settings['method'] != '' && $methods = array(
!in_array ($settings['method'], 'GET' => true,
array('GET', 'PUT', 'DELETE', 'POST'))) { 'POST' => true,
'DELETE' => true,
'PUT' => true,
);
$method = idx($settings, 'method');
if (strlen($method)) {
if (empty($methods[$method])) {
return false; return false;
} }
}
return true; return true;
} }