Trouble Retrieving X-Robots-Tag Added via .htaccess in Magento 2

For specific SEO requirements, I have added an X-Robots-Tag HTTP header via the .htaccess file on my server. However, I am facing an issue: I am unable to retrieve or read this header within Magento 2.

Here are the steps I have taken:

  1. Added the X-Robots-Tag header in the .htaccess file.
  2. Confirmed that the header is correctly set (visible through browser developer tools).
  3. Attempted to access this header in Magento 2. (getallheaders, getHeaders (with response class), $_SERVER …)

I am looking for advice or solutions on how to access the X-Robots-Tag header from within Magento 2. Is there a specific configuration required in Magento 2 or on the server to make this header accessible?

Thanks !