-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn user about HTTP No-Index headers #106
Conversation
I need to test this. |
@@ -396,6 +397,12 @@ private function buildUrl(string $url, bool $ignoreContentNotFoundErrors = false | |||
$output = ob_get_clean(); | |||
$content = $response->getContent() ?: $output; | |||
|
|||
if ($this->hasNoIndexHeader($response) && !$this->hasNoIndexTag($content)) { | |||
$this->logger->warning('Url "{url}" contains a "x-robots-tag: noindex" header that will be lost by going static. Consider using the HTML tag "<meta name="robots" content="noindex" />" instead.', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the progress bar (used in normal verbosity and interactive mode) may "eat" the first logs by redrawing over, the user might miss the warnings if there are only a few of them.
Note this is not an issue in CI (non-interactive), or whenever using another verbosity level (-v
is enough). But I've 1 or 2 idea(s) for gathering such warnings to be displayed at the end of the command execution with the progress bar.
Co-authored-by: Maxime Steinhausser <[email protected]>
Fix #65