Commit 96e44d90 by Jason Funk

Allow the developer to set the Content-Disposition header in Response::download()

parent cffded66
...@@ -202,9 +202,14 @@ class Response { ...@@ -202,9 +202,14 @@ class Response {
// off to the HttpFoundation and let it create the header text. // off to the HttpFoundation and let it create the header text.
$response = new static(File::get($path), 200, $headers); $response = new static(File::get($path), 200, $headers);
$d = $response->disposition($name); // If the Content-Disposition header has already been set by the
// merge above, then do not override it with out generated one.
if (!isset($headers['Content-Disposition'])) {
$d = $response->disposition($name);
$response = $response->header('Content-Disposition', $d);
}
return $response->header('Content-Disposition', $d); return $response;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment