summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-foundation/BinaryFileResponse.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-06-03 14:19:10 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-06-03 14:19:10 +0100
commit69c8d4f5c90cef75da102f92e4e992d03a8f1cd8 (patch)
tree4f956848961891482b64ee2cd5c8d7290936e354 /vendor/symfony/http-foundation/BinaryFileResponse.php
parent425f99bc29ab9e477e5407b5c86da5c85ba47461 (diff)
downloadwebtrees-69c8d4f5c90cef75da102f92e4e992d03a8f1cd8.tar.gz
webtrees-69c8d4f5c90cef75da102f92e4e992d03a8f1cd8.tar.bz2
webtrees-69c8d4f5c90cef75da102f92e4e992d03a8f1cd8.zip
:Update vendor dependencies
Diffstat (limited to 'vendor/symfony/http-foundation/BinaryFileResponse.php')
-rw-r--r--vendor/symfony/http-foundation/BinaryFileResponse.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/symfony/http-foundation/BinaryFileResponse.php b/vendor/symfony/http-foundation/BinaryFileResponse.php
index 115f486f02..e217820950 100644
--- a/vendor/symfony/http-foundation/BinaryFileResponse.php
+++ b/vendor/symfony/http-foundation/BinaryFileResponse.php
@@ -223,12 +223,17 @@ class BinaryFileResponse extends Response
list($pathPrefix, $location) = $part;
if (substr($path, 0, \strlen($pathPrefix)) === $pathPrefix) {
$path = $location.substr($path, \strlen($pathPrefix));
+ // Only set X-Accel-Redirect header if a valid URI can be produced
+ // as nginx does not serve arbitrary file paths.
+ $this->headers->set($type, $path);
+ $this->maxlen = 0;
break;
}
}
+ } else {
+ $this->headers->set($type, $path);
+ $this->maxlen = 0;
}
- $this->headers->set($type, $path);
- $this->maxlen = 0;
} elseif ($request->headers->has('Range')) {
// Process the range headers.
if (!$request->headers->has('If-Range') || $this->hasValidIfRangeHeader($request->headers->get('If-Range'))) {