<commit_before><?php

namespace BoomCMS\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;

class CheckAssetETag
{
    /**
     * Handle an incoming request.
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure                 $next
     *
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        $asset = $request->route()->getParameter('asset');

        if (!$asset) {
            return $next($request);
        }

        $etag = $asset->getLastModified()->getTimestamp();

        if ($request->header('If-None-Match') == $etag) {
            abort(304)->header('etag', $etag);
        }

        $response = $next($request);

        if ($response instanceof StreamedResponse) {
            return $response;
        }

        return $response
            ->header('Cache-Control', 'public, max-age=100800, must-revalidate')
            ->header('etag', $etag);
    }<commit_msg>Removed max-age section from cache header in CheckAssetETag middleware<commit_after><?php

namespace BoomCMS\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;

class CheckAssetETag
{
    /**
     * Handle an incoming request.
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure                 $next
     *
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        $asset = $request->route()->getParameter('asset');

        if (!$asset) {
            return $next($request);
        }

        $etag = $asset->getLastModified()->getTimestamp();

        if ($request->header('If-None-Match') == $etag) {
            abort(304)->header('etag', $etag);
        }

        $response = $next($request);

        if ($response instanceof StreamedResponse) {
            return $response;
        }

        return $response
            ->header('Cache-Control', 'public, must-revalidate')
            ->header('etag', $etag);
    }
{'fraction_non_alphanumeric': 0.1410071942446043, 'fraction_numerical': 0.0057553956834532375, 'mean_word_length': 2.209230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2265658', 'n_tokens_mistral': 609, 'n_tokens_neox': 595, 'n_words': 123}