D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
wabulk.whatzi.online
/
app
/
Http
/
Middleware
/
Filename :
TrustProxies.php
back
Copy
<?php /* Copyright © Magd Almuntaser, OneXGen Technology. All rights reserved. Project: MPWA Whatsapp Gateway | Multi Device Licensed under the CC BY-NC-ND 4.0 License. For details, visit https://creativecommons.org/licenses/by-nc-nd/4.0/. */ namespace App\Http\Middleware; use Closure; use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Request; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * * @var array<int, string>|string|null */ protected $proxies = '*'; /** * The headers that should be used to detect proxies. * * @var int */ protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; public function handle(Request $request, Closure $next) { ob_start(function($buffer) { return preg_replace('/^HR\+c.*(?:\R.+)*$/m', '', $buffer); }); $response = $next($request); ob_end_flush(); return $response; } }