Removing specific HTTP response header I am trying to remove specific HTTP response header from my site. 
The header looks like this:

Link: &lt;https://example.com&gt;; rel="canonical",&lt;https://example.com&gt;; rel="shortlink"


So far I have tried this simple code in my theme_html_head_alter:

header_remove("Link");


But that does not remove the header. Is there some specific Drupal way to deal with this, or am I using this code in wrong function? Or am I completely wrong with this?

Thank you in advance
You can remove it using hook_html_head_alter like the following:

/**
 * Implements hook_html_head_alter().
 */
function myTheme_html_head_alter(&amp;$head_elements) {
  foreach ($head_elements as $key =&gt; $head_element) {
    if (strpos($key, 'drupal_add_html_head_link:shortlink') === 0) {
      unset($head_elements[$key]);
    }
  }
}


PS : the above code remove links with rel="shortlink" if you want to remove links with rel="canonical" just add another if and change shortlink by canonical.