fix(stream): send RFC-compliant X-XC_VM-* probe/scan headers

The probe endpoint and the source scanner injected the prebuffer/detect
markers with a stray backslash in the header field-name
(`X-\XC_VM-Prebuffer` / `X-\XC_VM-Detect`), a leftover from the namespace
migration. A backslash is not a valid HTTP token character, so strict
origins/CDNs (e.g. Akamai) answer 400 Bad Request and the probe fails
silently (ffprobe runs with `-v quiet`), breaking Load Maps and stream
checks for otherwise-valid sources.

Use the correct `X-XC_VM-Prebuffer` / `X-XC_VM-Detect` names, matching what
StreamProcess sends and what auth.php/live.php read back.
This commit is contained in:
Divarion_D
2026-08-23 16:03:21 +03:00
parent af85102a4f
commit 84dfecb33f
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -122,11 +122,11 @@ class ScannerCommand implements CommandInterface {
if ($rStreamArguments[$rID]['argument_key'] != 'headers') {
continue;
}
$rStreamArguments[$rID]['value'] .= "\r\n" . 'X-\XC_VM-Detect:1';
$rStreamArguments[$rID]['value'] .= "\r\n" . 'X-XC_VM-Detect:1';
$rProcessed = true;
}
if (!$rProcessed) {
$rStreamArguments[] = array('value' => 'X-\XC_VM-Detect:1', 'argument_key' => 'headers', 'argument_cat' => 'fetch', 'argument_wprotocol' => 'http', 'argument_type' => 'text', 'argument_cmd' => "-headers '%s" . "\r\n" . "'");
$rStreamArguments[] = array('value' => 'X-XC_VM-Detect:1', 'argument_key' => 'headers', 'argument_cat' => 'fetch', 'argument_wprotocol' => 'http', 'argument_type' => 'text', 'argument_cmd' => "-headers '%s" . "\r\n" . "'");
}
}
@@ -136,11 +136,11 @@ class ScannerCommand implements CommandInterface {
if ($rStreamArguments[$rID]['argument_key'] != 'headers') {
continue;
}
$rStreamArguments[$rID]['value'] .= "\r\n" . 'X-\XC_VM-Prebuffer:1';
$rStreamArguments[$rID]['value'] .= "\r\n" . 'X-XC_VM-Prebuffer:1';
$rProcessed = true;
}
if (!$rProcessed) {
$rStreamArguments[] = array('value' => 'X-\XC_VM-Prebuffer:1', 'argument_key' => 'headers', 'argument_cat' => 'fetch', 'argument_wprotocol' => 'http', 'argument_type' => 'text', 'argument_cmd' => "-headers '%s" . "\r\n" . "'");
$rStreamArguments[] = array('value' => 'X-XC_VM-Prebuffer:1', 'argument_key' => 'headers', 'argument_cat' => 'fetch', 'argument_wprotocol' => 'http', 'argument_type' => 'text', 'argument_cmd' => "-headers '%s" . "\r\n" . "'");
}
}
@@ -528,7 +528,7 @@ class InternalApiController {
}
$rHeaders = !empty($rRequest['headers']) ? rtrim($rRequest['headers'], "\r\n") . "\r\n" : '';
$rHeaders .= 'X-\XC_VM-Prebuffer:1' . "\r\n";
$rHeaders .= 'X-XC_VM-Prebuffer:1' . "\r\n";
$rFetchArguments[] = sprintf('-headers %s', escapeshellarg($rHeaders));
exit(json_encode(array('result' => true, 'data' => FFprobeRunner::probeStream($rURL, $rFetchArguments, '', false))));