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:
parent
809e5a0389
commit
a2a4f4b3da
1 changed files with 12 additions and 4 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue