Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14908214
D21867.id52155.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21867.id52155.diff
View Options
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
@@ -886,10 +886,33 @@
}
$args_raw[] = $_SERVER[$header];
}
- $args_raw = implode('', $args_raw);
- return id(new PhutilQueryStringParser())
- ->parseQueryString($args_raw);
+ if ($args_raw) {
+ $args_raw = implode('', $args_raw);
+ return id(new PhutilQueryStringParser())
+ ->parseQueryString($args_raw);
+ }
+
+ // Sometimes arguments come in via the query string. Note that this will
+ // not handle multi-value entries e.g. "a[]=1,a[]=2" however it's unclear
+ // whether or how the mercurial protocol should handle this.
+ $query = idx($_SERVER, 'QUERY_STRING', '');
+ $query_pairs = id(new PhutilQueryStringParser())
+ ->parseQueryString($query);
+ foreach ($query_pairs 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 ($args_raw) {
+ return $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
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 12:09 PM (9 h, 1 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7122685
Default Alt Text
D21867.id52155.diff (1 KB)
Attached To
Mode
D21867: Updates for Mercurial's HTTP protocol
Attached
Detach File
Event Timeline
Log In to Comment