From bdd130bea25b583ff9fab2ffeef599f2f7f9d3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D9=90=D9=8A=D8=B2=D9=8E=D8=A7=D9=86=D9=8F=20=D8=A7?= =?UTF-8?q?=D9=84=D9=92=D8=AF=D9=91=D9=90=D9=8A=D9=86=D9=92=20=D8=B9=D9=8E?= =?UTF-8?q?=D8=A8=D9=92=D8=AF=D9=8F=20=D8=B0=D9=90=D9=8A=D9=92=20=D8=A7?= =?UTF-8?q?=D9=84=D9=92=D8=AC=D9=8E=D9=84=D9=8E=D8=A7=D9=84=D9=90=20=D9=88?= =?UTF-8?q?=D9=8E=20=D8=A7=D9=84=D9=92=D8=A5=D9=90=D9=83=D9=92=D8=B1=D9=8E?= =?UTF-8?q?=D8=A7=D9=85=D9=90?= Date: Thu, 11 Jul 2019 13:32:26 +0100 Subject: [PATCH] Update header --- bootstrap/wafMiddleware.php | 2 ++ routes/delete.php | 1 - routes/get.php | 1 - routes/post.php | 1 - routes/put.php | 1 - 5 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bootstrap/wafMiddleware.php b/bootstrap/wafMiddleware.php index 1f40c28..dd4f08b 100644 --- a/bootstrap/wafMiddleware.php +++ b/bootstrap/wafMiddleware.php @@ -25,6 +25,8 @@ // Add headers to request $request = $request->withAddedHeader('X-WAF-KEY', getenv('WAF_KEY')); + $request = $request->withAddedHeader('User-Agent', 'VesicaWAF/1.0 '); + $request = $request->withAddedHeader('X-LOAD-BALANCER', $request->getHeader('X-LOAD-BALANCER')); $wafNamespace = getenv('WAF_PROXY_NAMESPACE'); $logger = new Logger($wafNamespace); diff --git a/routes/delete.php b/routes/delete.php index 1d454e4..2596d75 100644 --- a/routes/delete.php +++ b/routes/delete.php @@ -22,7 +22,6 @@ ->forward($request) ->filter(function (Request $request, Response $response, $next) { // Manipulate the request object. - $request = $request->withAddedHeader('User-Agent', 'VesicaWAF/1.0 '); $request = $request->withHeader('X-Forwarded-For', $request->getHeader('X-Forwarded-For')); // Call the next item in the middleware. diff --git a/routes/get.php b/routes/get.php index fc1f12f..74d06fb 100644 --- a/routes/get.php +++ b/routes/get.php @@ -22,7 +22,6 @@ ->forward($request) ->filter(function (Request $request, Response $response, $next) { // Manipulate the request object. - $request = $request->withAddedHeader('User-Agent', 'VesicaWAF/1.0 '); $request = $request->withHeader('X-Forwarded-For', $request->getHeader('X-Forwarded-For')); // Call the next item in the middleware. diff --git a/routes/post.php b/routes/post.php index bf696b2..12ffeda 100644 --- a/routes/post.php +++ b/routes/post.php @@ -22,7 +22,6 @@ ->forward($request) ->filter(function (Request $request, Response $response, $next) { // Manipulate the request object. - $request = $request->withAddedHeader('User-Agent', 'VesicaWAF/1.0 '); $request = $request->withHeader('X-Forwarded-For', $request->getHeader('X-Forwarded-For')); // Call the next item in the middleware. diff --git a/routes/put.php b/routes/put.php index 795e14c..12b1b2d 100644 --- a/routes/put.php +++ b/routes/put.php @@ -22,7 +22,6 @@ ->forward($request) ->filter(function (Request $request, Response $response, $next) { // Manipulate the request object. - $request = $request->withAddedHeader('User-Agent', 'VesicaWAF/1.0 '); $request = $request->withHeader('X-Forwarded-For', $request->getHeader('X-Forwarded-For')); // Call the next item in the middleware.