<commit_before><?php

namespace App\Http\Middleware;

use Closure;

class IpCheck
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if ( ! \HmsHelper::inTheSpace($request)) {
            return redirect('home');
        }

        return $next($request);
    }
}<commit_msg>Add doc to IpCheck<commit_after><?php

namespace App\Http\Middleware;

use Closure;

/**
 * Middleware to check that the incoming request has a source IP form the hacksapce network,
 * bounce the request back to the index page if not
 */
class IpCheck
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if ( ! \HmsHelper::inTheSpace($request)) {
            return redirect('/');
        }

        return $next($request);
    }
}
{'fraction_non_alphanumeric': 0.11992445703493862, 'fraction_numerical': 0.0, 'mean_word_length': 2.241590214067278, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6414649', 'n_tokens_mistral': 328, 'n_tokens_neox': 325, 'n_words': 88}