X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=img_auth.php;h=fa1609f96398c83a68034e1e04d8fb21a238fde3;hb=ae99e6724355dac31083206c96a7b2a2ef0d755b;hp=d63618817a19ec4da0dc043aac146dff9fb7f2e1;hpb=ae69acacf567077b3f49d1fe6c3f3770e72a9093;p=lhc%2Fweb%2Fwiklou.git diff --git a/img_auth.php b/img_auth.php index d63618817a..fa1609f963 100644 --- a/img_auth.php +++ b/img_auth.php @@ -162,13 +162,21 @@ function wfImageAuthMain() { } } + $options = []; // HTTP header options + if ( isset( $_SERVER['HTTP_RANGE'] ) ) { + $options['range'] = $_SERVER['HTTP_RANGE']; + } + if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { + $options['if-modified-since'] = $_SERVER['HTTP_IF_MODIFIED_SINCE']; + } + if ( $request->getCheck( 'download' ) ) { $headers[] = 'Content-Disposition: attachment'; } // Stream the requested file wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." ); - $repo->streamFile( $filename, $headers ); + $repo->streamFile( $filename, $headers, $options ); } /**