Skip to content

Commit f4002a8

Browse files
Update RobotsMiddleware.php
1 parent f92be8f commit f4002a8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/RobotsMiddleware.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ public function handle(Request $request, Closure $next)
1313
{
1414
$this->response = $next($request);
1515

16-
if (array_key_exists('x-robots-tag', $this->response->headers->all())) {
17-
return $this->response;
18-
}
19-
2016
$shouldIndex = $this->shouldIndex($request);
2117

2218
if (is_bool($shouldIndex)) {
@@ -32,7 +28,7 @@ public function handle(Request $request, Closure $next)
3228

3329
protected function responseWithRobots(string $contents)
3430
{
35-
$this->response->headers['x-robots-tag'] = $contents;
31+
$this->response->headers->set('x-robots-tag', $contents, false);
3632

3733
return $this->response;
3834
}

0 commit comments

Comments
 (0)