mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-09-25 12:01:55 +02:00
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:
@@ -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))));
|
||||
|
||||
Reference in New Issue
Block a user