X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=img_auth.php;h=fa1609f96398c83a68034e1e04d8fb21a238fde3;hb=0a2ddab6778b4ef6c3bc1d95d3a4f9e621f318dd;hp=d63618817a19ec4da0dc043aac146dff9fb7f2e1;hpb=9ba3fca2d8adc56787c8efc32c41424cb212e387;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 ); } /**