Page MenuHomePhabricator

D21867.id52150.diff
No OneTemporary

D21867.id52150.diff

diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -888,10 +888,31 @@
}
$args_raw[] = $_SERVER[$header];
}
- $args_raw = implode('', $args_raw);
- return id(new PhutilQueryStringParser())
- ->parseQueryString($args_raw);
+ if (nonempty($args_raw)) {
+ $args_raw = implode('', $args_raw);
+ return id(new PhutilQueryStringParser())
+ ->parseQueryString($args_raw);
+ }
+
+ // Sometimes arguments come in via the query string.
+ $args_raw = array();
+ foreach ($_GET as $key => $value) {
+ // Filter out private/internal keys as well as the command itself.
+ if (strncmp($key, '__', 2) && $key != 'cmd') {
+ $args_raw[] = "{$key}={$value}";
+ }
+ }
+
+ if (nonempty($args_raw)) {
+ $args_raw = implode('&', $args_raw);
+ return id(new PhutilQueryStringParser())
+ ->parseQueryString($args_raw);
+ }
+
+ // TODO: Arguments can also come in via request body for POST requests. The
+ // body would be all arguments, url-encoded.
+ return array();
}
private function formatMercurialArguments($command, array $arguments) {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 7:07 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7706495
Default Alt Text
D21867.id52150.diff (1 KB)

Event Timeline