@@ -33,7 +33,6 @@ public function handle(Request $request, Closure $next)
33
33
return $ response ;
34
34
}
35
35
36
- // use the crawler to fetch the nodes we want from the response
37
36
$ this ->fetchLinkableNodes ($ response );
38
37
39
38
return $ response ;
@@ -48,20 +47,11 @@ protected function fetchLinkableNodes(Response $response)
48
47
{
49
48
$ crawler = $ this ->getCrawler ($ response );
50
49
51
- // look to see if link can have any type other than css or a font
52
- // distinguish font vs css by looking at extension, css vs eot or svg etc...
53
-
54
- // include images??
55
-
56
50
$ nodes = $ crawler ->filter ('link, script[src] ' )->extract (['src ' , 'href ' ]);
57
51
58
- // this is giving me a listing of LOCAL urls for any links or scripts
59
- // now I just need to determine which type, make sure you account for query strings on end
60
52
$ headers = collect ($ nodes )->flatten (1 )
61
53
->filter ()
62
- ->reject (function ($ url ) {
63
- return $ this ->isExternalUrl ($ url );
64
- })->map (function ($ url ) {
54
+ ->map (function ($ url ) {
65
55
return $ this ->buildLinkHeaderString ($ url );
66
56
})->filter ()
67
57
->implode (', ' );
@@ -89,16 +79,6 @@ protected function getCrawler(Response $response)
89
79
return $ this ->crawler = new Crawler ($ response ->getContent ());
90
80
}
91
81
92
- /**
93
- * @param $url
94
- * @return bool
95
- */
96
- private function isExternalUrl ($ url )
97
- {
98
- // is this a local fully qualified url
99
- return str_contains ($ url , "// " );
100
- }
101
-
102
82
/**
103
83
* @param String $url
104
84
* @return string
0 commit comments