mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10335] Add X-PHPBB-IS-BOT header so reverse proxies know about bots.
PHPBB3-10335
This commit is contained in:
parent
540ca1a8d8
commit
7a36c3b34b
2 changed files with 12 additions and 0 deletions
|
@ -173,6 +173,12 @@ if (defined('DEBUG_EXTRA') && request_var('explain', 0) && $auth->acl_get('a_'))
|
|||
header("Content-Type: application/atom+xml; charset=UTF-8");
|
||||
header("Last-Modified: " . gmdate('D, d M Y H:i:s', $feed_updated_time) . ' GMT');
|
||||
|
||||
if (!empty($user->data['is_bot']))
|
||||
{
|
||||
// Let reverse proxies know we detected a bot.
|
||||
header('X-PHPBB-IS-BOT: yes');
|
||||
}
|
||||
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
echo '<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="' . $global_vars['FEED_LANG'] . '">' . "\n";
|
||||
echo '<link rel="self" type="application/atom+xml" href="' . $global_vars['SELF_LINK'] . '" />' . "\n\n";
|
||||
|
|
|
@ -4641,6 +4641,12 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
|||
header('Expires: 0');
|
||||
header('Pragma: no-cache');
|
||||
|
||||
if (!empty($user->data['is_bot']))
|
||||
{
|
||||
// Let reverse proxies know we detected a bot.
|
||||
header('X-PHPBB-IS-BOT: yes');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue