Closed cameron1729 closed 7 months ago
Hi,
Thank you for bringing this issue to our attention. I have filed an internal work item to investigate this further.
Thanks, Joe
I have also filed https://tracker.moodle.org/browse/MDL-78510 with Moodle HQ as this is "kind of sort of" a regression. Even though $curl->info["header_size"]
is behaving correctly.
This is fixed by adding CURLOPT_SUPPRESS_CONNECT_HEADERS
if defined. Closing this for now.
@zeroAps I'm not sure what you mean. This is a bug in the panopto plugin that happens when CURLOPT_SUPPRESS_CONNECT_HEADERS
is defined. The problem is the way the plugin tries to split the response headers from the response body.
The plugin is using $curl->info["header_size"]
to split the response headers from the response body when it shouldn't. Has there been a code change in the plugin to rectify this?
Bug description
The code that splits the header and body from a response uses
$curl->info["header_size"]
which corresponds to the value of: https://curl.se/libcurl/c/CURLINFO_HEADER_SIZE.htmlNote that the description of
CURLINFO_HEADER_SIZE
specifies:Since Moodle 4.0.7 (specifically, MDL-76370), when using a proxy,
CURLOPT_SUPPRESS_CONNECT_HEADERS
is set: https://github.com/moodle/moodle/blob/v4.0.7/lib/filelib.php#L3188So if you are using a proxy which adds an additional connect header, then the value of
$curl->info["header_size"]
the length of that connect string is included, even though it's suppressed. Meaning that if you use it to try split the response headers from the body, you will have the wrong position.Replication steps
On Moodle 4.0.7+:
panoptotest.php
:docker run -d --name squid-container -e TZ=UTC -p 1729:3128 ubuntu/squid:5.2-22.04_beta