Wrong link building
This commit is contained in:
parent
5e454b3720
commit
94bb1d3c56
1 changed files with 5 additions and 1 deletions
|
@ -104,7 +104,11 @@ 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}" . 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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue