Skip to content

Commit 9d797fc

Browse files
committed
content disposition has correct filename now
1 parent b24f6e0 commit 9d797fc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Plugin/HeaderRewritePlugin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ function onHeadersReceived(ProxyEvent $event){
5050
}
5151

5252
if(!$response->headers->has('content-disposition')){
53-
$response->headers->set('Content-Disposition', 'filename="'.basename($request_url).'"');
53+
54+
$url_path = parse_url($request_url, PHP_URL_PATH);
55+
$filename = basename($url_path);
56+
57+
$response->headers->set('Content-Disposition', 'filename="'.$filename.'"');
5458
}
5559

5660
// do not ever cache our proxy pages!

0 commit comments

Comments
 (0)