Fixed session reset with HTTP/2 enabled

This commit is contained in:
Sergio Brighenti 2018-11-19 11:50:42 +01:00
parent 12c400116c
commit cc68de1779

View file

@ -104,7 +104,7 @@ class UploadController extends Controller
$media->text = $filesystem->read($media->storage_path);
} else if (in_array($type, ['image', 'video'])) {
$url = urlFor("/$args[userCode]/$args[mediaCode]/raw");
$response = $response->withHeader('Link', "<{$url}>; rel=preload; as={$type}");
$response = $response->withHeader('Link', "<{$url}>; rel=preload; as={$type}" . Session::get('logged', false) ? '; nopush' : '');
}
} catch (FileNotFoundException $e) {