Skip to content

Commit f8330ce

Browse files
authored
Merge pull request #49 from spotlibs/feature/security-helper
disable middleware activity for ping path
2 parents 974f8ef + 1031e2c commit f8330ce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Libraries/Security.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public static function encrypt(string $plaintext): string
6666
*/
6767
public static function decrypt(string $encrypted): string
6868
{
69-
7069
$ivHex = substr($encrypted, 0, 32);
7170
$iv = hex2bin($ivHex);
7271
$encrypted = substr($encrypted, 32);

src/Middlewares/ActivityMonitor.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public function __construct(Context $contextService)
5858
*/
5959
public function handle($request, Closure $next)
6060
{
61+
if ($request->path() == "ping") {
62+
return $next($request);
63+
}
6164
$meta = new Metadata();
6265
$meta->api_key = $request->header('X-Api-Key');
6366
$meta->app = $request->header('X-App');
@@ -107,6 +110,9 @@ public function handle($request, Closure $next)
107110
*/
108111
public function terminate($request, $response)
109112
{
113+
if ($request->path() == "ping") {
114+
return;
115+
}
110116
$fileData = (array) $this->contextService->get('fileData');
111117
$log = new StdClass();
112118
$log->app_name = getenv('APP_NAME');

0 commit comments

Comments
 (0)