Skip to content

Commit c4ce25a

Browse files
committed
Assert response is html before injecting alert or console outputs
1 parent 438e585 commit c4ce25a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Outputs/Alert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Alert implements Output
99
{
1010
public function output(Collection $detectedQueries, Response $response)
1111
{
12-
if ($response->isRedirection()) {
12+
if (stripos($response->headers->get('Content-Type'), 'text/html') !== 0 || $response->isRedirection()) {
1313
return;
1414
}
1515

src/Outputs/Console.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Console implements Output
99
{
1010
public function output(Collection $detectedQueries, Response $response)
1111
{
12-
if ($response->isRedirection()) {
12+
if (stripos($response->headers->get('Content-Type'), 'text/html') !== 0 || $response->isRedirection()) {
1313
return;
1414
}
1515

0 commit comments

Comments
 (0)