<commit_before><?php

// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

namespace App\Http;

use Fideloper\Proxy\TrustProxies;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * @var array
     */
    protected $middleware = [
        Middleware\DatadogMetrics::class,
    ];

    protected $middlewareGroups = [
        'api' => [
            Middleware\AuthApi::class,
            Middleware\SetLocale::class,
            Middleware\CheckUserBanStatus::class,
        ],
        'web' => [
            TrustProxies::class,
            Middleware\StripCookies::class,
            Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            Middleware\AutologinFromLegacyCookie::class,
            Middleware\VerifyCsrfToken::class,
            Middleware\SetLocale::class,
            Middleware\UpdateUserLastvisit::class,
            Middleware\VerifyUserAlways::class,
            Middleware\CheckUserBanStatus::class,
            Middleware\TurbolinksSupport::class,
        ],
        'lio' => [
            Middleware\LegacyInterOpAuth::class,
        ],
    ];

    /**
     * The application's route middleware.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'check-user-restricted' => Middleware\CheckUserRestricted::class,
        'guest' => Middleware\RedirectIfAuthenticated::class,
        'require-scopes' => Middleware\RequireScopes::class,
        'request-cost' => Middleware\RequestCost::class,
        'throttle' => Middleware\ThrottleRequests::class,
        'verify-user' => Middleware\VerifyUser::class,
    ];
}
<commit_msg>Use proxy trust middleware everywhere<commit_after><?php

// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

namespace App\Http;

use Fideloper\Proxy\TrustProxies;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * @var array
     */
    protected $middleware = [
        Middleware\DatadogMetrics::class,
    ];

    protected $middlewareGroups = [
        'api' => [
            TrustProxies::class,
            Middleware\AuthApi::class,
            Middleware\SetLocale::class,
            Middleware\CheckUserBanStatus::class,
        ],
        'web' => [
            TrustProxies::class,
            Middleware\StripCookies::class,
            Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            Middleware\AutologinFromLegacyCookie::class,
            Middleware\VerifyCsrfToken::class,
            Middleware\SetLocale::class,
            Middleware\UpdateUserLastvisit::class,
            Middleware\VerifyUserAlways::class,
            Middleware\CheckUserBanStatus::class,
            Middleware\TurbolinksSupport::class,
        ],
        'lio' => [
            TrustProxies::class,
            Middleware\LegacyInterOpAuth::class,
        ],
    ];

    /**
     * The application's route middleware.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'check-user-restricted' => Middleware\CheckUserRestricted::class,
        'guest' => Middleware\RedirectIfAuthenticated::class,
        'require-scopes' => Middleware\RequireScopes::class,
        'request-cost' => Middleware\RequestCost::class,
        'throttle' => Middleware\ThrottleRequests::class,
        'verify-user' => Middleware\VerifyUser::class,
    ];
}

{'fraction_non_alphanumeric': 0.11191662890801994, 'fraction_numerical': 0.0009062075215224287, 'mean_word_length': 2.557614826752619, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, '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': '4634075', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1261, 'n_words': 200}