On administrator back-end, on Systems > Global Configuration > Server Tab
I enable proxy and try to install other languages through Extensions>Manage>Install Languages.
Joomla purges the server response from the file of the update list,
and then parses the response body.
There is an error then saying it could not parse the https address...
After debugging the response of the https get request i saw that there was 2 headers in the response but joomla expects only 1 header.
In the below example the first header is the proxy response header and the second is the servers response header (the one that Joomla expects).
"HTTP/1.1 200 Connection established\r\n\r\nHTTP/1.1 200 OK\r\nDate: Mon, 18 Jul 2016 10:16:03 GMT\r\nContent-Type: application/xml\r\nContent-Length: 11500\r\nConnection: keep-alive\r\nLast-Modified: Mon, 18 Jul 2016 09:42:41 GMT\r\nCache-Control: max-age=600\r\nServer: NetDNA-cache/2.2\r\nX-Cache: HIT\r\nAccept-Ranges: bytes\r\n\r\n\n<extensionset name="Accredited Joomla! Translations" description="Accredited Joomla! Translations Updates. /// and the response continues blah blah blah
After joomla removes the first header it still cannot parse the response body as XML file because it still has another header remaining...
Debugging curl.php and specific on line 263 is that causes the real problem when updating behind a proxy
$response = explode("\r\n\r\n", $content, 2 + $redirects);
// Set the body for the response.
$return->body = array_pop($response);
I'm not sure why Joomla should think that a proxy does not give a response/header. I can tell you most proxy servers in default installation will give you a header indeed.
So someone needs to change the function to filtera response headers from the raw data and just use the body.
So someone needs to change the function to filtera response headers from the raw data and just use the body.
Except we don't want that to happen because part of the data that gets used to build the JHttpResponse
object IS the response headers. So the methods doing that splitting need to be smarter to better be able to split headers and body.
The method needs to be more precise.
Somehow it needs to understand if proxy sends a response and purge it also.
Hello from germany !
I also had trouble with updating joomla behind our company proxy. With the "curl.php" workaround which "pnkr" posted, now everything works fine.
So the only thing what we need now is a real solution for this misbehavior.
Hello from Brazil, same stuff here, workaround was good.
Status | New | ⇒ | Discussion |
Labels |
Added:
J3 Issue
|
Can someone please confirm that this is still an issue for them. There was a recent server change that is related to the headers.
If there is no response this willl be closed in a few weeks
Closing as no reply. Please open a new issue if problem still exists.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-10 16:38:17 |
Closed_By | ⇒ | infograf768 |
Digging deeper... the libraries/joomla/http/transport/curl.php in line 263
/*
* Split the response into headers and body. If cURL encountered redirects, the headers for the redirected requests will
* also be included. So we split the response into header + body + the number of redirects and only use the last two
* sections which should be the last set of headers and the actual body.
*/
If i change this :
$response = explode("\r\n\r\n", $content, 2 + $redirects);
to this:
$response = explode("\r\n\r\n", $content, 3 + $redirects);
Problem is solved, because it splits the proxy response also...BUT that could (in some cases) cause problems (for example if the xml has \r\n\r\n in a description node or something.....
So its not a perfect solution...
Why joomla is assuming that proxy server will not send a response?
does anyone have a thought about it?