Wrong link building
This commit is contained in:
parent
5e454b3720
commit
94bb1d3c56
|
@ -104,7 +104,11 @@ class UploadController extends Controller
|
||||||
$media->text = $filesystem->read($media->storage_path);
|
$media->text = $filesystem->read($media->storage_path);
|
||||||
} else if (in_array($type, ['image', 'video'])) {
|
} else if (in_array($type, ['image', 'video'])) {
|
||||||
$url = urlFor("/$args[userCode]/$args[mediaCode]/raw");
|
$url = urlFor("/$args[userCode]/$args[mediaCode]/raw");
|
||||||
$response = $response->withHeader('Link', "<{$url}>; rel=preload; as={$type}" . Session::get('logged', false) ? '; nopush' : '');
|
$header = "<{$url}>; rel=preload; as={$type}";
|
||||||
|
if (Session::get('logged', false)) {
|
||||||
|
$header .= '; nopush';
|
||||||
|
}
|
||||||
|
$response = $response->withHeader('Link', $header);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (FileNotFoundException $e) {
|
} catch (FileNotFoundException $e) {
|
||||||
|
|
Loading…
Reference in a new issue