Skip to main content
Sign in
Snippets Groups Projects
Commit 78d4cd04 authored by Thomas Müller's avatar Thomas Müller
Browse files

close the session in the proxy controller - enables parallel download

parent 354c3197
Branches
Tags
No related merge requests found
......@@ -86,7 +86,8 @@ class Application extends App {
return new ProxyController(
$c->query('AppName'),
$c->query('Request'),
$c->query('ServerContainer')->getURLGenerator()
$c->query('ServerContainer')->getURLGenerator(),
$c->query('ServerContainer')->getSession()
);
});
......
......
......@@ -30,11 +30,20 @@ use OCA\Mail\Http\ProxyDownloadResponse;
class ProxyController extends Controller {
/**
* @var \OCP\IURLGenerator
*/
private $urlGenerator;
public function __construct($appName, $request, IURLGenerator $urlGenerator){
/**
* @var \OCP\ISession
*/
private $session;
public function __construct($appName, $request, IURLGenerator $urlGenerator, \OCP\ISession $session){
parent::__construct($appName, $request);
$this->urlGenerator = $urlGenerator;
$this->session = $session;
}
/**
......@@ -83,6 +92,9 @@ class ProxyController extends Controller {
* @return ProxyDownloadResponse
*/
public function proxy() {
// close the session to allow parallel downloads
$this->session->close();
$resourceURL = $this->request->getParam('src');
$content = \OC_Util::getUrlContent($resourceURL);
return new ProxyDownloadResponse($content, $resourceURL, 'application/octet-stream');
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment