Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
#85 - fix bug for show content a other browsers (#97)
Browse files Browse the repository at this point in the history
* fix: bug for show other browsers

* fix: after review

* fix: after review

* fix: after review

Co-authored-by: aleksander.kowalski <[email protected]>
  • Loading branch information
MrHDOLEK and aleksander.kowalski authored May 5, 2022
1 parent 18c2e3f commit 42b76d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="{{ asset('/static/css/app.css') }}">
<link rel="stylesheet" href="{{ asset('/static/css/app.css') }}" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
Expand Down
6 changes: 4 additions & 2 deletions src/Http/Controllers/StaticController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

class StaticController extends Controller
{
private const IGNORED_HEADER_FILES_EXTENSIONS = [
"css",
];
private const IGNORE_FILES = [
".gitignore",
];
Expand All @@ -22,9 +25,8 @@ public function index(Request $request): BinaryFileResponse
if (!File::exists($path) || $this->filesFilter(File::basename($path))) {
abort(Response::HTTP_NOT_FOUND);
}

$headers = [
"Content-Type" => File::type($path),
"Content-Type" => in_array(File::extension($path), static::IGNORED_HEADER_FILES_EXTENSIONS, true) ? null : File::type($path),
];

return response()->file($path, $headers);
Expand Down

0 comments on commit 42b76d0

Please sign in to comment.